Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_data_chunk #21

Open
37 tasks done
ludnic opened this issue Apr 22, 2023 · 1 comment
Open
37 tasks done

test_data_chunk #21

ludnic opened this issue Apr 22, 2023 · 1 comment

Comments

@ludnic
Copy link
Collaborator

ludnic commented Apr 22, 2023

List of functions needed for test_data_chunk.f90

  • duckdb_append_data_chunk
  • duckdb_appender_create
  • duckdb_appender_destroy
  • duckdb_close
  • duckdb_column_count
  • duckdb_connect
  • duckdb_create_data_chunk
  • duckdb_create_list_type
  • duckdb_create_logical_type
  • duckdb_create_map_type
  • duckdb_data_chunk_get_column_count
  • duckdb_data_chunk_get_size
  • duckdb_data_chunk_get_vector
  • duckdb_data_chunk_reset
  • duckdb_data_chunk_set_size
  • duckdb_destroy_data_chunk
  • duckdb_destroy_logical_type
  • duckdb_destroy_result
  • duckdb_disconnect
  • duckdb_get_type_id
  • duckdb_list_type_child_type
  • duckdb_list_vector_get_child
  • duckdb_list_vector_get_size
  • duckdb_list_vector_reserve
  • duckdb_list_vector_set_size
  • duckdb_map_type_key_type
  • duckdb_map_type_value_type
  • duckdb_open
  • duckdb_query
  • duckdb_result_chunk_count
  • duckdb_result_get_chunk
  • duckdb_validity_row_is_valid
  • duckdb_validity_set_row_validity
  • duckdb_vector_get_column_type
  • duckdb_vector_get_data
  • duckdb_vector_get_validity
  • duckdb_vector_size
@freevryheid
Copy link
Owner

The lines following
https://github.com/freevryheid/duckdb/blob/main/test/test_data_chunk.f90#L239

don't look right to me.

I'm still trying to figure out this function that returns a c pointer:
duckdb_vector_get_data

From:
https://github.com/duckdb/duckdb/blob/master/test/api/capi/test_capi_data_chunk.cpp#L135

The lines

	auto col1_ptr = (int64_t *)duckdb_vector_get_data(duckdb_data_chunk_get_vector(data_chunk, 0));
	*col1_ptr = 42;

I don't know c++ but I suspect that the function

duckdb_data_chunk_get_vector(data_chunk, 0)

should return a c_int64_t. Why I don't know as data_chunk in the test appears to be NULL. 42 is then mapped to this memory address.

We may need a helper function for duckdb_vector_get_data that converts the c pointer to a fortran (target) pointer that we can then map/assign to as in "=>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants