[GitHub] [calcite] XuQianJin-Stars edited a comment on issue #1143: [CALCITE-2884] Implement JSON_INSERT, JSON_REPLACE, JSON_SET

2019-05-18 Thread GitBox
XuQianJin-Stars edited a comment on issue #1143: [CALCITE-2884] Implement 
JSON_INSERT, JSON_REPLACE, JSON_SET
URL: https://github.com/apache/calcite/pull/1143#issuecomment-493668753
 
 
   hi @zhztheplayer @ritesh-kapoor @danny0405 @pengzhiwei2018 @chunweilei  
Thank you very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars edited a comment on issue #1150: [CALCITE-2985] Implement JSON_STORAGE_SIZE function

2019-05-18 Thread GitBox
XuQianJin-Stars edited a comment on issue #1150: [CALCITE-2985] Implement 
JSON_STORAGE_SIZE function
URL: https://github.com/apache/calcite/pull/1150#issuecomment-493668708
 
 
   hi @hsyuan @zhztheplayer @danny0405 @pengzhiwei2018 @chunweilei  Thank you 
very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars edited a comment on issue #1168: [CALCITE-3005] Implement string functions: LEFT, RIGHT

2019-05-18 Thread GitBox
XuQianJin-Stars edited a comment on issue #1168: [CALCITE-3005] Implement 
string functions: LEFT, RIGHT
URL: https://github.com/apache/calcite/pull/1168#issuecomment-493668649
 
 
   hi @chunweilei @pengzhiwei2018 @julianhyde @danny0405 @zhztheplayer  Thank 
you very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] chunweilei commented on issue #1209: [CALCITE-2601] Add REVERSE function

2019-05-18 Thread GitBox
chunweilei commented on issue #1209: [CALCITE-2601] Add REVERSE function
URL: https://github.com/apache/calcite/pull/1209#issuecomment-493683142
 
 
   Also please resolve conflicts and squash commits.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] chunweilei commented on a change in pull request #1209: [CALCITE-2601] Add REVERSE function

2019-05-18 Thread GitBox
chunweilei commented on a change in pull request #1209: [CALCITE-2601] Add 
REVERSE function
URL: https://github.com/apache/calcite/pull/1209#discussion_r285345170
 
 

 ##
 File path: site/_docs/reference.md
 ##
 @@ -2097,6 +2098,7 @@ semantics.
 | m | JSON_LENGTH(jsonValue [, path ])   | Returns a integer 
indicating the length of *jsonValue*
 | m | JSON_KEYS(jsonValue [, path ]) | Returns a string 
indicating the keys of a JSON *jsonValue*
 | m | JSON_REMOVE(jsonValue, path[, path])   | Removes data from 
*jsonValue* using a series of *path* expressions and returns the result
+| m | REVERSE(string)| Returns the reverse 
order of string values
 | o | DECODE(value, value1, result1 [, valueN, resultN ]* [, default ]) | 
Compares *value* to each *valueN* value one by one; if *value* is equal to a 
*valueN*, returns the corresponding *resultN*, else returns *default*, or NULL 
if *default* is not specified
 
 Review comment:
   Please change the description to `Returns the reverse order of *string*` 
just like other format.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] chunweilei commented on a change in pull request #1215: [CALCITE-3068] testSubprogram() does not test whether subprogram gets re-executed

2019-05-18 Thread GitBox
chunweilei commented on a change in pull request #1215: [CALCITE-3068] 
testSubprogram() does not test whether subprogram gets re-executed
URL: https://github.com/apache/calcite/pull/1215#discussion_r285345035
 
 

 ##
 File path: core/src/test/java/org/apache/calcite/test/HepPlannerTest.java
 ##
 @@ -251,14 +251,15 @@ private void assertIncludesExactlyOnce(String message, 
String digest, String sub
 subprogramBuilder.addMatchOrder(HepMatchOrder.TOP_DOWN);
 subprogramBuilder.addMatchLimit(1);
 subprogramBuilder.addRuleInstance(ProjectToCalcRule.INSTANCE);
+subprogramBuilder.addRuleInstance(FilterToCalcRule.INSTANCE);
 subprogramBuilder.addRuleInstance(CalcMergeRule.INSTANCE);
 
 HepProgramBuilder programBuilder = HepProgram.builder();
 programBuilder.addSubprogram(subprogramBuilder.build());
 
 checkPlanning(
 programBuilder.build(),
-"select upper(ename) from (select lower(ename) as ename from emp)");
+"select upper(ename) from (select lower(ename) as ename from emp where 
empno = 100)");
 
 Review comment:
   You're right. So I changed this test and it will break if the subProgram 
does not really fire 2 times. The original plan of the test shows the 
difference.  


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] danny0405 commented on a change in pull request #1157: [CALCITE-2969] Improve design of join-like relational expressions

2019-05-18 Thread GitBox
danny0405 commented on a change in pull request #1157: [CALCITE-2969] Improve 
design of join-like relational expressions
URL: https://github.com/apache/calcite/pull/1157#discussion_r285341786
 
 

 ##
 File path: site/_docs/history.md
 ##
 @@ -39,6 +39,17 @@ Guava versions 19.0 to 27.1-jre;
 Apache Druid version 0.14.0-incubating;
 other software versions as specified in `pom.xml`.
 
+ Breaking Changes
+
+* Make `EnumerableMergeJoin` extend `Join` instead of `EquiJoin`
+* `Correlate` use `JoinRelType` instead of `SemiJoinType`
+* Rename `EnumerableThetaJoin` to `EnumerableNestedLoopJoin`
+* Rename `EnumerableJoin` to `EnumerableHashJoin`
+* Remove `SemiJoinFactory` from `RelBuilder`, method `semiJoin` now returns a 
`LogicalJoin` 
+with join type `JoinRelType.SEMI` instead of a `SemiJoin`
+* Rules: `SemiJoinFilterTransposeRule`, `SemiJoinJoinTransposeRule`, 
`SemiJoinProjectTransposeRule`
+and `SemiJoinRemoveRule` matches `LogicalJoin` with join type `SEMI` instead 
of `SemiJoin`.  
 
 Review comment:
   Yep, thanks.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] danny0405 commented on a change in pull request #1157: [CALCITE-2969] Improve design of join-like relational expressions

2019-05-18 Thread GitBox
danny0405 commented on a change in pull request #1157: [CALCITE-2969] Improve 
design of join-like relational expressions
URL: https://github.com/apache/calcite/pull/1157#discussion_r285341533
 
 

 ##
 File path: core/src/main/java/org/apache/calcite/rel/core/JoinRelType.java
 ##
 @@ -94,6 +150,37 @@ public JoinRelType cancelNullsOnRight() {
   return this;
 }
   }
+
+  /** Transform this JoinRelType to CorrelateJoinType. **/
+  public CorrelateJoinType toLinq4j() {
+switch (this) {
+case INNER:
+  return CorrelateJoinType.INNER;
+case LEFT:
+  return CorrelateJoinType.LEFT;
+case SEMI:
+  return CorrelateJoinType.SEMI;
+case ANTI:
+  return CorrelateJoinType.ANTI;
+}
+throw new IllegalStateException(
+"Unable to convert " + this + " to CorrelateJoinType");
+  }
+
+  public boolean projectsRight() {
+switch (this) {
+case INNER:
+case LEFT:
+case RIGHT:
+case FULL:
+  return true;
+case SEMI:
+case ANTI:
+  return false;
+}
+throw new IllegalStateException(
 
 Review comment:
   Thanks @zabetak, let's just keep is as now.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] zabetak commented on a change in pull request #1157: [CALCITE-2969] Improve design of join-like relational expressions

2019-05-18 Thread GitBox
zabetak commented on a change in pull request #1157: [CALCITE-2969] Improve 
design of join-like relational expressions
URL: https://github.com/apache/calcite/pull/1157#discussion_r285339604
 
 

 ##
 File path: site/_docs/history.md
 ##
 @@ -39,6 +39,17 @@ Guava versions 19.0 to 27.1-jre;
 Apache Druid version 0.14.0-incubating;
 other software versions as specified in `pom.xml`.
 
+ Breaking Changes
+
+* Make `EnumerableMergeJoin` extend `Join` instead of `EquiJoin`
+* `Correlate` use `JoinRelType` instead of `SemiJoinType`
+* Rename `EnumerableThetaJoin` to `EnumerableNestedLoopJoin`
+* Rename `EnumerableJoin` to `EnumerableHashJoin`
+* Remove `SemiJoinFactory` from `RelBuilder`, method `semiJoin` now returns a 
`LogicalJoin` 
+with join type `JoinRelType.SEMI` instead of a `SemiJoin`
+* Rules: `SemiJoinFilterTransposeRule`, `SemiJoinJoinTransposeRule`, 
`SemiJoinProjectTransposeRule`
+and `SemiJoinRemoveRule` matches `LogicalJoin` with join type `SEMI` instead 
of `SemiJoin`.  
 
 Review comment:
   Typo: s/matches/match/


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] zabetak commented on a change in pull request #1157: [CALCITE-2969] Improve design of join-like relational expressions

2019-05-18 Thread GitBox
zabetak commented on a change in pull request #1157: [CALCITE-2969] Improve 
design of join-like relational expressions
URL: https://github.com/apache/calcite/pull/1157#discussion_r285339438
 
 

 ##
 File path: core/src/main/java/org/apache/calcite/rel/core/JoinRelType.java
 ##
 @@ -94,6 +150,37 @@ public JoinRelType cancelNullsOnRight() {
   return this;
 }
   }
+
+  /** Transform this JoinRelType to CorrelateJoinType. **/
+  public CorrelateJoinType toLinq4j() {
+switch (this) {
+case INNER:
+  return CorrelateJoinType.INNER;
+case LEFT:
+  return CorrelateJoinType.LEFT;
+case SEMI:
+  return CorrelateJoinType.SEMI;
+case ANTI:
+  return CorrelateJoinType.ANTI;
+}
+throw new IllegalStateException(
+"Unable to convert " + this + " to CorrelateJoinType");
+  }
+
+  public boolean projectsRight() {
+switch (this) {
+case INNER:
+case LEFT:
+case RIGHT:
+case FULL:
+  return true;
+case SEMI:
+case ANTI:
+  return false;
+}
+throw new IllegalStateException(
 
 Review comment:
   Let's go for 1.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars commented on issue #1143: [CALCITE-2884] Implement JSON_INSERT, JSON_REPLACE, JSON_SET

2019-05-18 Thread GitBox
XuQianJin-Stars commented on issue #1143: [CALCITE-2884] Implement JSON_INSERT, 
JSON_REPLACE, JSON_SET
URL: https://github.com/apache/calcite/pull/1143#issuecomment-493668753
 
 
   hi @zhztheplayer @ritesh-kapoor Thank you very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars commented on issue #1163: [CALCITE-2995] Add the DAYNAME,MONTHNAME function

2019-05-18 Thread GitBox
XuQianJin-Stars commented on issue #1163: [CALCITE-2995] Add the 
DAYNAME,MONTHNAME function
URL: https://github.com/apache/calcite/pull/1163#issuecomment-493668680
 
 
   hi @hsyuan @chunweilei Thank you very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars commented on issue #1168: [CALCITE-3005] Implement string functions: LEFT, RIGHT

2019-05-18 Thread GitBox
XuQianJin-Stars commented on issue #1168: [CALCITE-3005] Implement string 
functions: LEFT, RIGHT
URL: https://github.com/apache/calcite/pull/1168#issuecomment-493668649
 
 
   hi @chunweilei @pengzhiwei2018 @julianhyde Thank you very much,Comments 
addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [calcite] XuQianJin-Stars commented on issue #1150: [CALCITE-2985] Implement JSON_STORAGE_SIZE function

2019-05-18 Thread GitBox
XuQianJin-Stars commented on issue #1150: [CALCITE-2985] Implement 
JSON_STORAGE_SIZE function
URL: https://github.com/apache/calcite/pull/1150#issuecomment-493668708
 
 
   hi @hsyuan @zhztheplayer Thank you very much,Comments addressed.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services