This is an automated email from the ASF dual-hosted git repository.
NSAmelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 8cca599a402 IGNITE-29308 SQL Calcite: Skip unwrapping of simple column
values (#13844)
8cca599a402 is described below
commit 8cca599a402895f69dcace7471543830837c0a44
Author: Nikita Amelchev <[email protected]>
AuthorDate: Thu Nov 19 14:21:08 2026 +0300
IGNITE-29308 SQL Calcite: Skip unwrapping of simple column values (#13844)
---
.../query/calcite/schema/CacheTableDescriptorImpl.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java
index 42956234da1..f4557df7dfb 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java
@@ -47,6 +47,7 @@ import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.CacheStoppedException;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheContextInfo;
@@ -641,6 +642,15 @@ public class CacheTableDescriptorImpl extends
NullInitializerExpressionFactory
return true;
}
+ /** */
+ private static Object unwrap(Object val, GridCacheContext<?, ?> cctx,
boolean keepBinary) {
+ // Fast path: simple values have nothing to unwrap.
+ if (val == null || QueryUtils.isSqlType(val.getClass()))
+ return val;
+
+ return cctx.unwrapBinaryIfNeeded(val, keepBinary, null);
+ }
+
/** */
private static class KeyValDescriptor implements CacheColumnDescriptor {
/** */
@@ -733,7 +743,10 @@ public class CacheTableDescriptorImpl extends
NullInitializerExpressionFactory
/** {@inheritDoc} */
@Override public Object value(ExecutionContext<?> ectx,
GridCacheContext<?, ?> cctx, CacheDataRow src) {
- return cctx.unwrapBinaryIfNeeded(isKey ? src.key() : src.value(),
ectx.keepBinary(), null);
+ CacheObject co = isKey ? src.key() : src.value();
+
+ return co.isPlatformType() ?
unwrap(co.value(cctx.cacheObjectContext(), true), cctx, ectx.keepBinary())
+ : cctx.unwrapBinaryIfNeeded(co, ectx.keepBinary(), null);
}
/** {@inheritDoc} */
@@ -819,7 +832,7 @@ public class CacheTableDescriptorImpl extends
NullInitializerExpressionFactory
/** {@inheritDoc} */
@Override public Object value(ExecutionContext<?> ectx,
GridCacheContext<?, ?> cctx, CacheDataRow src)
throws IgniteCheckedException {
- return cctx.unwrapBinaryIfNeeded(desc.value(src.key(),
src.value()), ectx.keepBinary(), null);
+ return unwrap(desc.value(src.key(), src.value()), cctx,
ectx.keepBinary());
}
/** {@inheritDoc} */