[GitHub] cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line
cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line URL: https://github.com/apache/spark/pull/23276#discussion_r251281683 ## File path: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala ## @@ -331,6 +337,65 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { console.printInfo(s"Spark master: $master, Application Id: $appId") } + // method body imported from Hive and translated from Java to Scala + override def processLine(line: String, allowInterrupting: Boolean): Int = { Review comment: I checked the hive code and seems the `;` is well handled at least in the master branch: https://github.com/apache/hive/blob/master/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java#L395 Do you mean only Hive 1.2 has this bug? Maybe we should upgrade hive. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line
cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line URL: https://github.com/apache/spark/pull/23276#discussion_r251279295 ## File path: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala ## @@ -331,6 +337,65 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { console.printInfo(s"Spark master: $master, Application Id: $appId") } + // method body imported from Hive and translated from Java to Scala + override def processLine(line: String, allowInterrupting: Boolean): Int = { Review comment: so the default `processLine` implementation doesn't handle `;` well? do you mean hive sql shell have this bug as well? This is an automated message from the Apache Git Service. To respond to the message, please log on 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 - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line
cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line URL: https://github.com/apache/spark/pull/23276#discussion_r251279142 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala ## @@ -90,12 +93,145 @@ object StringUtils { funcNames.toSeq } + /** + * Split the text into one or more SQLs with bracketed comments reserved + * + * Highlighted Corner Cases: semicolon in double quotes, single quotes or inline comments. + * Expected Behavior: The blanks will be trimed and a blank line will be omitted. + * + * @param text One or more SQLs separated by semicolons + * @return the trimmed SQL array (Array is for Java introp) + */ + def split(text: String): Array[String] = { Review comment: where do we call this method? This is an automated message from the Apache Git Service. To respond to the message, please log on 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 - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line
cloud-fan commented on a change in pull request #23276: [SPARK-26321][SQL] Improve the behavior of sql text splitting for the spark-sql command line URL: https://github.com/apache/spark/pull/23276#discussion_r251279142 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala ## @@ -90,12 +93,145 @@ object StringUtils { funcNames.toSeq } + /** + * Split the text into one or more SQLs with bracketed comments reserved + * + * Highlighted Corner Cases: semicolon in double quotes, single quotes or inline comments. + * Expected Behavior: The blanks will be trimed and a blank line will be omitted. + * + * @param text One or more SQLs separated by semicolons + * @return the trimmed SQL array (Array is for Java introp) + */ + def split(text: String): Array[String] = { Review comment: where do we call this method? This is an automated message from the Apache Git Service. To respond to the message, please log on 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 - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org