Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](iceberg) Write binary columns with proper Arrow types#64949
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
a8e1ff98454eec3972330479c6452a7ea88File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -25,6 +25,7 @@ namespace doris::iceberg { | ||
| const char* ArrowSchemaUtil::PARQUET_FIELD_ID = "PARQUET:field_id"; | ||
| const char* ArrowSchemaUtil::ORIGINAL_TYPE = "originalType"; | ||
| const char* ArrowSchemaUtil::MAP_TYPE_VALUE = "mapType"; | ||
| const char* ArrowSchemaUtil::UUID_TYPE_VALUE = "uuid"; | ||
| Status ArrowSchemaUtil::convert(const Schema* schema, const std::string& timezone, | ||
| std::vector<std::shared_ptr<arrow::Field>>& fields) { | ||
| @@ -75,13 +76,25 @@ Status ArrowSchemaUtil::convert_to(const iceberg::NestedField& field, | ||
| break; | ||
| } | ||
| case iceberg::TypeID::BINARY: | ||
| case iceberg::TypeID::STRING: | ||
| case iceberg::TypeID::UUID: | ||
| case iceberg::TypeID::FIXED: | ||
| arrow_type = arrow::utf8(); | ||
| break; | ||
| case iceberg::TypeID::BINARY: | ||
Gabriel39 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| arrow_type = arrow::binary(); | ||
| break; | ||
| case iceberg::TypeID::UUID: | ||
| metadata[ORIGINAL_TYPE] = UUID_TYPE_VALUE; | ||
| arrow_type = arrow::fixed_size_binary(16); | ||
Gabriel39 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| break; | ||
| case iceberg::TypeID::FIXED: { | ||
| iceberg::FixedType* fixed_type = static_cast<iceberg::FixedType*>(field.field_type()); | ||
| arrow_type = arrow::fixed_size_binary(fixed_type->get_length()); | ||
| break; | ||
| } | ||
| case iceberg::TypeID::DECIMAL: { | ||
| auto* dt = dynamic_cast<DecimalType*>(field.field_type()); | ||
| arrow_type = arrow::decimal(dt->get_precision(), dt->get_scale()); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.