Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nevi-me committed Mar 15, 2021
1 parent 6ca973c commit 203f8da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rust/parquet/src/arrow/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,11 @@ fn arrow_to_parquet_type(field: &Field) -> Result<Type> {
DataType::Float64 => Type::primitive_type_builder(name, PhysicalType::DOUBLE)
.with_repetition(repetition)
.build(),
DataType::Timestamp(time_unit, zone) => {
DataType::Timestamp(time_unit, _) => {
Type::primitive_type_builder(name, PhysicalType::INT64)
.with_logical_type(Some(LogicalType::TIMESTAMP(TimestampType {
is_adjusted_to_u_t_c: matches!(zone, Some(z) if z.as_str() == "UTC"),
// Logic to adjust timestamps not yet implemented
is_adjusted_to_u_t_c: false,
unit: match time_unit {
TimeUnit::Second => ParquetTimeUnit::MILLIS(Default::default()),
TimeUnit::Millisecond => {
Expand Down Expand Up @@ -784,7 +785,6 @@ impl ParquetTypeConverter<'_> {
/// This function takes care of logical type and repetition.
fn to_group_type(&self) -> Result<Option<DataType>> {
if self.is_repeated() {
dbg!(self.schema.get_basic_info());
self.to_struct().map(|opt| {
opt.map(|dt| {
DataType::List(Box::new(Field::new(
Expand Down
6 changes: 3 additions & 3 deletions rust/parquet/src/schema/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl<'a> PrimitiveTypeBuilder<'a> {
self.precision
));
}
self.test_decimal_precision_scale()?;
self.check_decimal_precision_scale()?;
}
(LogicalType::DATE(_), PhysicalType::INT32) => {}
(
Expand Down Expand Up @@ -380,7 +380,7 @@ impl<'a> PrimitiveTypeBuilder<'a> {
}
}
ConvertedType::DECIMAL => {
self.test_decimal_precision_scale()?;
self.check_decimal_precision_scale()?;
}
ConvertedType::DATE
| ConvertedType::TIME_MILLIS
Expand Down Expand Up @@ -441,7 +441,7 @@ impl<'a> PrimitiveTypeBuilder<'a> {
}

#[inline]
fn test_decimal_precision_scale(&self) -> Result<()> {
fn check_decimal_precision_scale(&self) -> Result<()> {
match self.physical_type {
PhysicalType::INT32
| PhysicalType::INT64
Expand Down

0 comments on commit 203f8da

Please sign in to comment.