You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/28 05:11:22 UTC

[GitHub] [calcite] ritesh-kapoor opened a new pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

ritesh-kapoor opened a new pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361904529
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2281,6 +2281,7 @@ semantics.
 | m | DAYNAME(datetime)                              | Returns the name, in the connection's locale, of the weekday in *datetime*; for example, it returns '星期日' for both DATE '2020-02-10' and TIMESTAMP '2020-02-10 10:10:10'
 | 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
 | p | DIFFERENCE(string, string)                     | Returns a measure of the similarity of two strings, namely the number of character positions that their `SOUNDEX` values have in common: 4 if the `SOUNDEX` values are same and 0 if the `SOUNDEX` values are totally different
+| o | EXTRACT(xml, xpath, [, namespace ])            | Returns the xml fragment of the element or elements matched by the XPath expression.
 | m | EXTRACTVALUE(xml, xpathExpr))                  | Returns the text of the first text node which is a child of the element or elements matched by the XPath expression.
 
 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361884894
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java
 ##########
 @@ -231,6 +231,11 @@ public Consistency getConsistency() {
   public static final FamilyOperandTypeChecker STRING_STRING_STRING =
       family(SqlTypeFamily.STRING, SqlTypeFamily.STRING, SqlTypeFamily.STRING);
 
+  public static final SqlSingleOperandTypeChecker STRING_STRING_OPTIONAL_STRING =
+      family(ImmutableList.of(SqlTypeFamily.STRING, SqlTypeFamily.STRING, SqlTypeFamily.STRING),
 
 Review comment:
   The type should be `FamilyOperandTypeChecker`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
chunweilei commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361885699
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/util/SimpleNamespaceContext.java
 ##########
 @@ -0,0 +1,67 @@
+/*
+ * 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.util;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+
+public class SimpleNamespaceContext implements NamespaceContext {
+
 
 Review comment:
   +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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361904517
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java
 ##########
 @@ -231,6 +231,11 @@ public Consistency getConsistency() {
   public static final FamilyOperandTypeChecker STRING_STRING_STRING =
       family(SqlTypeFamily.STRING, SqlTypeFamily.STRING, SqlTypeFamily.STRING);
 
+  public static final SqlSingleOperandTypeChecker STRING_STRING_OPTIONAL_STRING =
+      family(ImmutableList.of(SqlTypeFamily.STRING, SqlTypeFamily.STRING, SqlTypeFamily.STRING),
 
 Review comment:
   Previously referred NUMERIC_OPTIONAL_INTEGER. I have done the changes :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
ritesh-kapoor commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361904535
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/util/SimpleNamespaceContext.java
 ##########
 @@ -0,0 +1,67 @@
+/*
+ * 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.util;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+
+public class SimpleNamespaceContext implements NamespaceContext {
+
 
 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361885539
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2281,6 +2281,7 @@ semantics.
 | m | DAYNAME(datetime)                              | Returns the name, in the connection's locale, of the weekday in *datetime*; for example, it returns '星期日' for both DATE '2020-02-10' and TIMESTAMP '2020-02-10 10:10:10'
 | 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
 | p | DIFFERENCE(string, string)                     | Returns a measure of the similarity of two strings, namely the number of character positions that their `SOUNDEX` values have in common: 4 if the `SOUNDEX` values are same and 0 if the `SOUNDEX` values are totally different
+| o | EXTRACT(xml, xpath, [, namespace ])            | Returns the xml fragment of the element or elements matched by the XPath expression.
 | m | EXTRACTVALUE(xml, xpathExpr))                  | Returns the text of the first text node which is a child of the element or elements matched by the XPath expression.
 
 Review comment:
   Also give a doc about the optional argument `namespace`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei closed pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
chunweilei closed pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1701: [CALCITE-3580] Oracle EXTRACT(XML) Function Support
URL: https://github.com/apache/calcite/pull/1701#discussion_r361884752
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/util/SimpleNamespaceContext.java
 ##########
 @@ -0,0 +1,67 @@
+/*
+ * 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.util;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+
+public class SimpleNamespaceContext implements NamespaceContext {
+
 
 Review comment:
   Give some java doc about what is this class used for.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services