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

Support PrimitiveTypeBuilder when Logical type is Timestamp and Physical type is BYTE_ARRAY #5365

Closed
Weijun-H opened this issue Feb 6, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Weijun-H
Copy link
Member

Weijun-H commented Feb 6, 2024

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I got an error when I was trying to build PrimitiveTypeBuilder on apache/datafusion#9129.

thread 'datasource::physical_plan::parquet::row_groups::tests::row_group_pruning_predicate_timestamp' panicked at datafusion/core/src/datasource/physical_plan/parquet/row_groups.rs:1206:42:
called `Result::unwrap()` on an `Err` value: General("Cannot annotate Timestamp { is_adjusted_to_u_t_c: false, unit: NANOS(NanoSeconds) } from BYTE_ARRAY for field 'c1'")

Describe the solution you'd like

Add (LogicalType::Timestamp { _, _}, PhysicalType::BYTE_ARRAY)=>{} in

match (logical_type, self.physical_type) {
(LogicalType::Map, _) | (LogicalType::List, _) => {
return Err(general_err!(
"{:?} cannot be applied to a primitive type for field '{}'",
logical_type,
self.name
));

Describe alternatives you've considered

Additional context

@Weijun-H Weijun-H added the enhancement Any new improvement worthy of a entry in the changelog label Feb 6, 2024
@tustvold
Copy link
Contributor

tustvold commented Feb 6, 2024

The parquet logical type for timestamps can only annotate an int64 - https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#timestamp

@Weijun-H Weijun-H closed this as completed Feb 7, 2024
@tustvold tustvold added question Further information is requested and removed enhancement Any new improvement worthy of a entry in the changelog labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants