You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2023/08/21 20:09:57 UTC

[GitHub] [pinot] xiangfu0 opened a new pull request, #11400: [multistage] Don't parse timestampAdd and timestampDiff functions in CalciteSqlParser

xiangfu0 opened a new pull request, #11400:
URL: https://github.com/apache/pinot/pull/11400

   (no comment)


-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on a diff in pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #11400:
URL: https://github.com/apache/pinot/pull/11400#discussion_r1300707910


##########
pinot-query-planner/src/main/java/org/apache/calcite/sql2rel/PinotConvertletTable.java:
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.calcite.sql2rel;
+
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+
+/**
+ * PinotConvertletTable is a wrapper of {@link StandardConvertletTable} with the customizations of not converting
+ * certain SqlCalls, e.g. TIMESTAMPADD, TIMESTAMPDIFF.
+ */
+public class PinotConvertletTable implements SqlRexConvertletTable {
+
+  public static final PinotConvertletTable INSTANCE = new PinotConvertletTable();
+
+  private PinotConvertletTable() {
+  }
+
+  @Override
+  public @Nullable SqlRexConvertlet get(SqlCall call) {
+    switch (call.getKind()) {
+      case TIMESTAMP_ADD:
+        return TimestampAddConvertlet.INSTANCE;
+      case TIMESTAMP_DIFF:
+        return TimestampDiffConvertlet.INSTANCE;

Review Comment:
   Then there is no way to convert SqlNode to RexNode, the exception is needToImplement Xxxx
   There has to be an implementation for every sqlkind. 



-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #11400:
URL: https://github.com/apache/pinot/pull/11400#discussion_r1300704743


##########
pinot-query-planner/src/main/java/org/apache/calcite/sql2rel/PinotConvertletTable.java:
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.calcite.sql2rel;
+
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+
+/**
+ * PinotConvertletTable is a wrapper of {@link StandardConvertletTable} with the customizations of not converting
+ * certain SqlCalls, e.g. TIMESTAMPADD, TIMESTAMPDIFF.
+ */
+public class PinotConvertletTable implements SqlRexConvertletTable {
+
+  public static final PinotConvertletTable INSTANCE = new PinotConvertletTable();
+
+  private PinotConvertletTable() {
+  }
+
+  @Override
+  public @Nullable SqlRexConvertlet get(SqlCall call) {

Review Comment:
   (minor)
   ```suggestion
     @Nullable
     @Override
     public SqlRexConvertlet get(SqlCall call) {
   ```



##########
pinot-query-planner/src/main/java/org/apache/calcite/sql2rel/PinotConvertletTable.java:
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.calcite.sql2rel;
+
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+
+/**
+ * PinotConvertletTable is a wrapper of {@link StandardConvertletTable} with the customizations of not converting
+ * certain SqlCalls, e.g. TIMESTAMPADD, TIMESTAMPDIFF.
+ */
+public class PinotConvertletTable implements SqlRexConvertletTable {
+
+  public static final PinotConvertletTable INSTANCE = new PinotConvertletTable();
+
+  private PinotConvertletTable() {
+  }
+
+  @Override
+  public @Nullable SqlRexConvertlet get(SqlCall call) {
+    switch (call.getKind()) {
+      case TIMESTAMP_ADD:
+        return TimestampAddConvertlet.INSTANCE;
+      case TIMESTAMP_DIFF:
+        return TimestampDiffConvertlet.INSTANCE;

Review Comment:
   Does it work if we simply do
   ```suggestion
         case TIMESTAMP_ADD:
         case TIMESTAMP_DIFF:
           return null;
   ```



-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] codecov-commenter commented on pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #11400:
URL: https://github.com/apache/pinot/pull/11400#issuecomment-1687042889

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/11400?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#11400](https://app.codecov.io/gh/apache/pinot/pull/11400?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (0a6a76d) into [master](https://app.codecov.io/gh/apache/pinot/commit/bfa4e9a36bd42354116904cf2717472305f70755?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (bfa4e9a) will **decrease** coverage by `62.80%`.
   > Report is 1 commits behind head on master.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #11400       +/-   ##
   =============================================
   - Coverage     62.79%    0.00%   -62.80%     
   =============================================
     Files          2300     2224       -76     
     Lines        123496   119892     -3604     
     Branches      18718    18240      -478     
   =============================================
   - Hits          77548        0    -77548     
   - Misses        40450   119892    +79442     
   + Partials       5498        0     -5498     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-0.01%)` | :arrow_down: |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (ø)` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-17](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-20](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-62.65%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <0.00%> (-62.80%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/11400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files Changed](https://app.codecov.io/gh/apache/pinot/pull/11400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [.../java/org/apache/pinot/query/QueryEnvironment.java](https://app.codecov.io/gh/apache/pinot/pull/11400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvUXVlcnlFbnZpcm9ubWVudC5qYXZh) | `0.00% <0.00%> (-90.60%)` | :arrow_down: |
   | [.../query/planner/logical/RelToPlanNodeConverter.java](https://app.codecov.io/gh/apache/pinot/pull/11400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcGxhbm5lci9sb2dpY2FsL1JlbFRvUGxhbk5vZGVDb252ZXJ0ZXIuamF2YQ==) | `0.00% <ø> (-86.61%)` | :arrow_down: |
   
   ... and [1950 files with indirect coverage changes](https://app.codecov.io/gh/apache/pinot/pull/11400/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on a diff in pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #11400:
URL: https://github.com/apache/pinot/pull/11400#discussion_r1300707910


##########
pinot-query-planner/src/main/java/org/apache/calcite/sql2rel/PinotConvertletTable.java:
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.calcite.sql2rel;
+
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+
+/**
+ * PinotConvertletTable is a wrapper of {@link StandardConvertletTable} with the customizations of not converting
+ * certain SqlCalls, e.g. TIMESTAMPADD, TIMESTAMPDIFF.
+ */
+public class PinotConvertletTable implements SqlRexConvertletTable {
+
+  public static final PinotConvertletTable INSTANCE = new PinotConvertletTable();
+
+  private PinotConvertletTable() {
+  }
+
+  @Override
+  public @Nullable SqlRexConvertlet get(SqlCall call) {
+    switch (call.getKind()) {
+      case TIMESTAMP_ADD:
+        return TimestampAddConvertlet.INSTANCE;
+      case TIMESTAMP_DIFF:
+        return TimestampDiffConvertlet.INSTANCE;

Review Comment:
   Then there is no way to convert SqlNode to RexNode.
   There has to be an implementation for every sqlkind. 



-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 merged pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 merged PR #11400:
URL: https://github.com/apache/pinot/pull/11400


-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] xiangfu0 commented on pull request #11400: [multistage] Retain timestampAdd and timestampDiff functions during SqlNode to RexNode conversion

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #11400:
URL: https://github.com/apache/pinot/pull/11400#issuecomment-1687130530

   Correct, will do that


-- 
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@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org