zstan commented on code in PR #6406:
URL: https://github.com/apache/ignite-3/pull/6406#discussion_r2272411142
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/RexUtils.java:
##########
@@ -1191,6 +1202,34 @@ public Void visitLocalRef(RexLocalRef locRef) {
return val;
}
+ /** Return literal holding java object according to it`s type. */
+ public static @Nullable Object getValueFromLiteral(NativeType
physicalType, RexLiteral lit) {
Review Comment:
i change it, if i correctly understand your suggestion
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/partitionawareness/PartitionAwarenessMetadataExtractor.java:
##########
@@ -113,11 +124,31 @@ public static PartitionAwarenessMetadata
getMetadata(IgniteKeyValueModify kv) {
if (expr instanceof RexDynamicParam) {
RexDynamicParam dynamicParam = (RexDynamicParam) expr;
indexes[i] = dynamicParam.getIndex();
+ onlyLiterals = false;
+ } else if (expr instanceof RexLiteral) {
+ RexLiteral expr0 = (RexLiteral) expr;
+
+ // depends on supplied zoneId, it can`t be cached
+ if (expr0.getTypeName() ==
SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) {
+ return null;
+ }
+
+ indexes[i] = hashPos--;
+ NativeType nativeType =
IgniteTypeFactory.relDataTypeToNative(expr0.getType());
+ Object val = getValueFromLiteral(nativeType, expr0);
+ hashFields.add(ColocationUtils.hash(val, nativeType));
} else {
return null;
}
}
+ // case for IgniteKeyValueModify with only literals in colocation
columns.
+ if (fullRow && onlyLiterals) {
+ return null;
Review Comment:
done
--
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]