amogh-jahagirdar commented on code in PR #14882:
URL: https://github.com/apache/iceberg/pull/14882#discussion_r2788799700
##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -775,18 +776,20 @@ static void clearPlanningState() {
*
* @param scan the scan to configure
* @param request the plan table scan request containing filters and
projections
+ * @param schema the table schema to use for type-aware filter
deserialization
* @param <T> the specific scan type (TableScan, IncrementalAppendScan, etc.)
* @return the configured scan with filters and projections applied
*/
private static <T extends Scan<T, FileScanTask, ?>> T configureScan(
- T scan, PlanTableScanRequest request) {
+ T scan, PlanTableScanRequest request, Schema schema) {
Review Comment:
The schema to use would always be the configured schema for the scan no? In
that case I think we can get rid of the 3rd argument and just do
request.filter(configuredScan.schema()) below
##########
core/src/main/java/org/apache/iceberg/SingleValueParser.java:
##########
@@ -119,41 +119,14 @@ public static Object fromJson(Type type, JsonNode
defaultValue) {
}
return uuid;
case DATE:
- Preconditions.checkArgument(
- defaultValue.isTextual(), "Cannot parse default as a %s value:
%s", type, defaultValue);
- return DateTimeUtil.isoDateToDays(defaultValue.textValue());
+ return parseDateValue(type, defaultValue);
case TIME:
- Preconditions.checkArgument(
- defaultValue.isTextual(), "Cannot parse default as a %s value:
%s", type, defaultValue);
- return DateTimeUtil.isoTimeToMicros(defaultValue.textValue());
+ return parseTimeValue(type, defaultValue);
case TIMESTAMP:
- Preconditions.checkArgument(
- defaultValue.isTextual(), "Cannot parse default as a %s value:
%s", type, defaultValue);
- if (((Types.TimestampType) type).shouldAdjustToUTC()) {
- String timestampTz = defaultValue.textValue();
- Preconditions.checkArgument(
Review Comment:
These are the same as before right? Just a pure refactoring? I'd prefer to
keep it as is just to minimize the diff, but not a hard opinion.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]