moving development to master for a while since there is no need for branching yet #8
@@ -1,4 +1,5 @@
|
||||
#include <duckdb.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -27,7 +28,7 @@ int main(int argc, char** argv){
|
||||
|
||||
//Test query
|
||||
duckdb_result result;
|
||||
duckdb_query(conn, "SELECT * from \"Engine RPM\";\n", &result);
|
||||
duckdb_query(conn, "SELECT * from \"Ambient Temperature\";\n", &result);
|
||||
int32_t iterations = 0;
|
||||
int32_t number_of_data_points = 0;
|
||||
|
||||
@@ -44,13 +45,13 @@ int main(int argc, char** argv){
|
||||
|
||||
//first column
|
||||
duckdb_vector col1 = duckdb_data_chunk_get_vector(data_chunk, 0);
|
||||
int32_t *col1_data = (int32_t *) duckdb_vector_get_data(col1);
|
||||
float_t *col1_data = (float_t *) duckdb_vector_get_data(col1);
|
||||
uint64_t *col1_validity = duckdb_vector_get_validity(col1);
|
||||
|
||||
for (idx_t row = 0; row < row_count; row++) {
|
||||
number_of_data_points++;
|
||||
if(duckdb_validity_row_is_valid(col1_validity, row)){
|
||||
printf("%d, ", col1_data[row]);
|
||||
printf("%f, ", col1_data[row]);
|
||||
}else{
|
||||
printf("NULL");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user