You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2026/08/03 13:11:34 UTC
[PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
tkalkirill opened a new pull request, #5144:
URL: https://github.com/apache/calcite/pull/5144
<!--
Thanks for sending a pull request! Here are some critical tips for you:
1. READ THE GUIDE FIRST: https://calcite.apache.org/develop/#contributing
*For significant contributions, please discuss on the dev mailing list or Jira BEFORE coding.*
2. JIRA IS USUALLY MANDATORY: Ensure you have created an issue on the Calcite Jira:
https://issues.apache.org/jira/projects/CALCITE/issues
*Check existing issues first to avoid duplicates.*
*Note: A Jira is NOT required for typos and cosmetic changes (i.e., changes that are neither bugs nor features).*
3. TIMING: Strongly recommended to create the Jira BEFORE you start writing code (e.g., a day or so before posting a PR).
This gives others a chance to weigh in on your specification.
4. CRITICAL CONSISTENCY RULE
The following three items MUST match exactly in wording and meaning:
(A) The Jira Issue Title
(B) This Pull Request Title
(C) Your Git Commit Message
Format: [CALCITE-XXXX] <Description>
Example: [CALCITE-0000] Add IF NOT EXISTS clause to CREATE TABLE
Guidelines for a good Title:
- Illustrate using SQL keywords (in ALL-CAPS) rather than Java method names.
- Focus on the specification and user experience, not the implementation.
- Make it clear whether it is a bug or a feature.
- Use words like "should" to indicate desired behavior vs. current behavior (e.g., "Validator should not close model file").
5. REPRODUCTION: If fixing a bug, please provide a concise SQL example or test case to reproduce the issue for a faster review.
6. TESTING: Ensure `./gradlew build` passes and appropriate tests are added/updated.
-->
## Jira Link
[CALCITE-7688](https://issues.apache.org/jira/browse/CALCITE-7688)
## Changes Proposed
This PR introduces support for scalar subqueries and expressions containing scalar subqueries in table function arguments:
```
SELECT * FROM TABLE(my_function((SELECT value FROM t), 1));
SELECT * FROM TABLE(my_function((SELECT 4) + (SELECT 6), 1));
SELECT *
FROM person p
CROSS JOIN LATERAL TABLE(
my_function((SELECT p.id + 1), p.id)
);
```
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5213629311
Please squash the commits for merging
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5171406918
the commit message is not ideal.
Is this work in progress, or is it ready for review?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3721100233
##########
core/src/main/java/org/apache/calcite/interpreter/Nodes.java:
##########
@@ -46,8 +46,9 @@ public class Nodes {
* that knows how to handle the core logical
* {@link org.apache.calcite.rel.RelNode}s. */
public static class CoreCompiler extends Interpreter.CompilerImpl {
- CoreCompiler(@UnknownInitialization Interpreter interpreter, RelOptCluster cluster) {
- super(interpreter, cluster);
+ CoreCompiler(@UnknownInitialization Interpreter interpreter,
Review Comment:
Fix it.
##########
core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java:
##########
@@ -136,6 +137,8 @@ private AccumulatorFactory getAccumulator(Compiler compiler,
final Class<?> clazz = maxMinClass(call);
return new UdaAccumulatorFactory(getAggFunction(clazz), call, true,
dataContext);
+ } else if (op == SqlStdOperatorTable.SINGLE_VALUE) {
Review Comment:
Fix it.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3726111203
##########
testkit/src/main/java/org/apache/calcite/util/Smalls.java:
##########
@@ -111,6 +111,12 @@ public class Smalls {
public static final Method MULTIPLICATION_TABLE_METHOD =
Types.lookupMethod(Smalls.class, "multiplicationTable", int.class,
int.class, Integer.class);
+ public static final Method SCALAR_QUERY_ARGUMENTS_TABLE_METHOD =
Review Comment:
Smalls like teen spirit.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3722941758
##########
core/src/test/java/org/apache/calcite/test/TableFunctionTest.java:
##########
@@ -400,6 +411,139 @@ private Connection getConnectionWithMultiplyFunction() throws SQLException {
"row_name=row 2; c1=103; c2=106");
}
+ @Test void testTableFunctionWithScalarQueryLiteralAndColumnArguments() {
Review Comment:
I hope that you have validated these results in some way.
Maybe you can say how.
Ideally you wrote a test oracle (a separate program) which verified these results.
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -1017,6 +1023,66 @@ private static void matchFilter(SubQueryRemoveRule rule,
call.transformTo(builder.build());
}
+ private static void matchTableFunctionScan(SubQueryRemoveRule rule,
+ RelOptRuleCall call) {
+ final TableFunctionScan scan = call.rel(0);
+ final RexSubQuery e =
+ requireNonNull(findScalarQuery(scan.getCall()));
+
+ final RelBuilder builder = call.builder();
+ builder.push(e.rel);
+ builder.aggregate(builder.groupKey(),
+ builder.aggregateCall(SqlStdOperatorTable.SINGLE_VALUE,
+ builder.field(0)));
+ final RelNode scalarValue = builder.build();
+
+ final CorrelationId correlationId =
+ scan.getCluster().createCorrel();
+ final RexCorrelVariable correlationVariable =
+ (RexCorrelVariable) scan.getCluster().getRexBuilder()
+ .makeCorrel(scalarValue.getRowType(), correlationId);
+ final RexNode target =
+ scan.getCluster().getRexBuilder()
+ .makeFieldAccess(correlationVariable, 0);
+ final RexNode newCall =
+ scan.getCall().accept(new ReplaceSubQueryShuttle(e, target));
+ final TableFunctionScan newScan =
+ (TableFunctionScan) scan.copy(scan.getTraitSet(), scan.getInputs(),
+ newCall, scan.getElementType(), scan.getRowType(),
+ scan.getColumnMappings())
+ .withHints(scan.getHints());
+
+ final RelNode correlate =
+ LogicalCorrelate.create(scalarValue, newScan, ImmutableList.of(),
+ correlationId, ImmutableBitSet.of(0), JoinRelType.INNER);
+ builder.push(correlate);
+ final int scalarFieldCount =
+ scalarValue.getRowType().getFieldCount();
+ builder.project(
+ IntStream.range(0, scan.getRowType().getFieldCount())
+ .mapToObj(i -> builder.field(scalarFieldCount + i))
+ .collect(Collectors.toList()),
+ scan.getRowType().getFieldNames());
+ call.transformTo(builder.build());
+ }
+
+ private static @Nullable RexSubQuery findScalarQuery(RexNode node) {
Review Comment:
Isn't there another public implementation of a similar visitor you can reuse?
##########
testkit/src/main/java/org/apache/calcite/util/Smalls.java:
##########
@@ -111,6 +111,12 @@ public class Smalls {
public static final Method MULTIPLICATION_TABLE_METHOD =
Types.lookupMethod(Smalls.class, "multiplicationTable", int.class,
int.class, Integer.class);
+ public static final Method SCALAR_QUERY_ARGUMENTS_TABLE_METHOD =
Review Comment:
I wonder why this file is named Smalls.java.
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -1017,6 +1023,66 @@ private static void matchFilter(SubQueryRemoveRule rule,
call.transformTo(builder.build());
}
+ private static void matchTableFunctionScan(SubQueryRemoveRule rule,
Review Comment:
please add some javadoc explaining the shape of the rewriting that goes on here.
an example input and output plan would work great.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5219233802
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [94.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5174368450
@mihaibudiu It's a habit from the IGNITE project, where they don't pay as much attention to commit messages. It's ready for review, could you take a look?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5169295671
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [86.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_coverage&view=list)
 [2.7% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5202547782
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [94.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3727183660
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -1017,6 +1023,66 @@ private static void matchFilter(SubQueryRemoveRule rule,
call.transformTo(builder.build());
}
+ private static void matchTableFunctionScan(SubQueryRemoveRule rule,
Review Comment:
I tried to fix this.
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -1017,6 +1023,66 @@ private static void matchFilter(SubQueryRemoveRule rule,
call.transformTo(builder.build());
}
+ private static void matchTableFunctionScan(SubQueryRemoveRule rule,
+ RelOptRuleCall call) {
+ final TableFunctionScan scan = call.rel(0);
+ final RexSubQuery e =
+ requireNonNull(findScalarQuery(scan.getCall()));
+
+ final RelBuilder builder = call.builder();
+ builder.push(e.rel);
+ builder.aggregate(builder.groupKey(),
+ builder.aggregateCall(SqlStdOperatorTable.SINGLE_VALUE,
+ builder.field(0)));
+ final RelNode scalarValue = builder.build();
+
+ final CorrelationId correlationId =
+ scan.getCluster().createCorrel();
+ final RexCorrelVariable correlationVariable =
+ (RexCorrelVariable) scan.getCluster().getRexBuilder()
+ .makeCorrel(scalarValue.getRowType(), correlationId);
+ final RexNode target =
+ scan.getCluster().getRexBuilder()
+ .makeFieldAccess(correlationVariable, 0);
+ final RexNode newCall =
+ scan.getCall().accept(new ReplaceSubQueryShuttle(e, target));
+ final TableFunctionScan newScan =
+ (TableFunctionScan) scan.copy(scan.getTraitSet(), scan.getInputs(),
+ newCall, scan.getElementType(), scan.getRowType(),
+ scan.getColumnMappings())
+ .withHints(scan.getHints());
+
+ final RelNode correlate =
+ LogicalCorrelate.create(scalarValue, newScan, ImmutableList.of(),
+ correlationId, ImmutableBitSet.of(0), JoinRelType.INNER);
+ builder.push(correlate);
+ final int scalarFieldCount =
+ scalarValue.getRowType().getFieldCount();
+ builder.project(
+ IntStream.range(0, scan.getRowType().getFieldCount())
+ .mapToObj(i -> builder.field(scalarFieldCount + i))
+ .collect(Collectors.toList()),
+ scan.getRowType().getFieldNames());
+ call.transformTo(builder.build());
+ }
+
+ private static @Nullable RexSubQuery findScalarQuery(RexNode node) {
Review Comment:
I tried to fix this.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3727180899
##########
core/src/test/java/org/apache/calcite/test/TableFunctionTest.java:
##########
@@ -400,6 +411,139 @@ private Connection getConnectionWithMultiplyFunction() throws SQLException {
"row_name=row 2; c1=103; c2=106");
}
+ @Test void testTableFunctionWithScalarQueryLiteralAndColumnArguments() {
Review Comment:
I validated the expected results independently against Oracle using a standalone PL/SQL test oracle https://onecompiler.com/plsql/44xe3ubj8. The program defines a pipelined table function and invokes it with the same scalar subquery, literal, and correlated outer-column arguments. Oracle produced (100, 10, 20, 100) and (200, 10, 20, 200), which matches the test expectations.
Or did you mean something else?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5182481792
I will review, but to merge this you will have to use the same commit message as the JIRA issue title.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #5144:
URL: https://github.com/apache/calcite/pull/5144
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5219005900
@mihaibudiu 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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5166991633
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [86.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_coverage&view=list)
 [2.7% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5144:
URL: https://github.com/apache/calcite/pull/5144#issuecomment-5191785609
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5144&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5144&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [92.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5144&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5144)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7688] Support scalar subqueries in table function arguments [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #5144:
URL: https://github.com/apache/calcite/pull/5144#discussion_r3714851801
##########
core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java:
##########
@@ -136,6 +137,8 @@ private AccumulatorFactory getAccumulator(Compiler compiler,
final Class<?> clazz = maxMinClass(call);
return new UdaAccumulatorFactory(getAggFunction(clazz), call, true,
dataContext);
+ } else if (op == SqlStdOperatorTable.SINGLE_VALUE) {
Review Comment:
I am not sure how this is related to the issue being solved.
Maybe these fixes should be in the scope of a separate JIRA issue.
##########
core/src/main/java/org/apache/calcite/interpreter/Nodes.java:
##########
@@ -46,8 +46,9 @@ public class Nodes {
* that knows how to handle the core logical
* {@link org.apache.calcite.rel.RelNode}s. */
public static class CoreCompiler extends Interpreter.CompilerImpl {
- CoreCompiler(@UnknownInitialization Interpreter interpreter, RelOptCluster cluster) {
- super(interpreter, cluster);
+ CoreCompiler(@UnknownInitialization Interpreter interpreter,
Review Comment:
I am not sure you can change public APIs, that would be a violation of semantic versioning.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org