pvary commented on code in PR #18144:
URL: https://github.com/apache/iceberg/pull/18144#discussion_r4120407269
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/IcebergTableSource.java:
##########
@@ -237,4 +249,50 @@ public DynamicTableSource copy() {
public String asSummaryString() {
return "Iceberg table source";
}
+
+ @Override
+ public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext context)
{
+ int[][] lookupKeys = context.getKeys();
+ int[] lookupKeyIndexes = new int[lookupKeys.length];
+ for (int i = 0; i < lookupKeys.length; i++) {
+ Preconditions.checkArgument(
+ lookupKeys[i].length == 1, "Iceberg lookup source doesn't support
nested lookup key.");
+ lookupKeyIndexes[i] = lookupKeys[i][0];
+ }
+
+ ResolvedSchema projected = getProjectedSchema();
+ RowType projectedRowType = (RowType)
projected.toPhysicalRowDataType().getLogicalType();
+
+ LookupOptions.LookupCacheType requestedCacheType =
+ flinkConfParser
+ .enumConfParser(LookupOptions.LookupCacheType.class)
+ .option(LookupOptions.CACHE_TYPE.key())
+ .parseOptional();
+ Preconditions.checkArgument(
+ requestedCacheType == null || requestedCacheType ==
LookupOptions.LookupCacheType.FULL,
+ "Iceberg lookup join only supports %s=FULL, but it is set to '%s'.
NONE and PARTIAL are "
+ + "not supported, because an Iceberg table cannot be
point-looked-up.",
+ LookupOptions.CACHE_TYPE.key(),
+ requestedCacheType);
+
+ boolean eagerLoad =
+ flinkConfParser
+ .booleanConf()
+ .option(IcebergLookupOptions.FULL_CACHE_EAGER_LOAD.key())
+
.defaultValue(IcebergLookupOptions.FULL_CACHE_EAGER_LOAD.defaultValue())
+ .parse();
+
+ boolean caseSensitive =
+ flinkConfParser
+ .booleanConf()
+ .option(FlinkReadOptions.CASE_SENSITIVE)
+ .flinkConfig(FlinkReadOptions.CASE_SENSITIVE_OPTION)
+
.defaultValue(FlinkReadOptions.CASE_SENSITIVE_OPTION.defaultValue())
+ .parse();
Review Comment:
could we resue `FlinkReadConf.caseSensitive()`?
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/IcebergTableSource.java:
##########
@@ -237,4 +249,50 @@ public DynamicTableSource copy() {
public String asSummaryString() {
return "Iceberg table source";
}
+
+ @Override
+ public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext context)
{
+ int[][] lookupKeys = context.getKeys();
+ int[] lookupKeyIndexes = new int[lookupKeys.length];
+ for (int i = 0; i < lookupKeys.length; i++) {
+ Preconditions.checkArgument(
+ lookupKeys[i].length == 1, "Iceberg lookup source doesn't support
nested lookup key.");
+ lookupKeyIndexes[i] = lookupKeys[i][0];
+ }
+
+ ResolvedSchema projected = getProjectedSchema();
+ RowType projectedRowType = (RowType)
projected.toPhysicalRowDataType().getLogicalType();
+
+ LookupOptions.LookupCacheType requestedCacheType =
+ flinkConfParser
+ .enumConfParser(LookupOptions.LookupCacheType.class)
+ .option(LookupOptions.CACHE_TYPE.key())
+ .parseOptional();
+ Preconditions.checkArgument(
+ requestedCacheType == null || requestedCacheType ==
LookupOptions.LookupCacheType.FULL,
+ "Iceberg lookup join only supports %s=FULL, but it is set to '%s'.
NONE and PARTIAL are "
+ + "not supported, because an Iceberg table cannot be
point-looked-up.",
+ LookupOptions.CACHE_TYPE.key(),
+ requestedCacheType);
+
+ boolean eagerLoad =
+ flinkConfParser
+ .booleanConf()
+ .option(IcebergLookupOptions.FULL_CACHE_EAGER_LOAD.key())
+
.defaultValue(IcebergLookupOptions.FULL_CACHE_EAGER_LOAD.defaultValue())
+ .parse();
+
+ boolean caseSensitive =
+ flinkConfParser
+ .booleanConf()
+ .option(FlinkReadOptions.CASE_SENSITIVE)
+ .flinkConfig(FlinkReadOptions.CASE_SENSITIVE_OPTION)
+
.defaultValue(FlinkReadOptions.CASE_SENSITIVE_OPTION.defaultValue())
+ .parse();
Review Comment:
could we reuse `FlinkReadConf.caseSensitive()`?
--
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]