rdblue commented on code in PR #11904: URL: https://github.com/apache/iceberg/pull/11904#discussion_r1925922076
########## parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java: ########## @@ -192,13 +222,17 @@ public Optional<ParquetValueWriters.PrimitiveWriter<?>> visit( @Override public Optional<ParquetValueWriters.PrimitiveWriter<?>> visit( LogicalTypeAnnotation.DateLogicalTypeAnnotation dateType) { - return Optional.of(new DateWriter(desc)); + return Optional.ofNullable(dateWriter(desc)); } @Override public Optional<ParquetValueWriters.PrimitiveWriter<?>> visit( LogicalTypeAnnotation.TimeLogicalTypeAnnotation timeType) { - return Optional.of(new TimeWriter(desc)); + Preconditions.checkArgument( + LogicalTypeAnnotation.TimeUnit.MICROS.equals(timeType.getUnit()), + "Cannot write time in %s, only MICROS is supported", + timeType.getUnit()); + return Optional.ofNullable(timeWriter(desc)); Review Comment: I don't think there is a need for a pass-through. That behavior isn't very easy to follow if you're trying to understand what this is doing. Instead, it's better to always implement `timeWriter` and others. ########## parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java: ########## @@ -190,33 +210,49 @@ public Optional<ParquetValueWriters.PrimitiveWriter<?>> visit( } @Override - public Optional<ParquetValueWriters.PrimitiveWriter<?>> visit( + public Optional<ParquetValueWriter<?>> visit( LogicalTypeAnnotation.DateLogicalTypeAnnotation dateType) { - return Optional.of(new DateWriter(desc)); + ParquetValueWriter<?> dateWriter = dateWriter(desc); + if (dateWriter != null) { + return Optional.of(dateWriter(desc)); + } + + return LogicalTypeAnnotation.LogicalTypeAnnotationVisitor.super.visit(dateType); Review Comment: Is your intent to not support dates, times, or timestamps for the internal model? If so, why? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org