Github user adrian-wang commented on a diff in the pull request:
https://github.com/apache/spark/pull/2770#discussion_r18809978
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala ---
@@ -224,6 +225,11 @@ private[hive] object HiveQl {
try {
val tree = getAst(sql)
if (nativeCommands contains tree.getText) {
+ if(tree.asInstanceOf[ASTNode].getText == "TOK_TRUNCATETABLE"){
+ if(tree.getChildren.exists(_.asInstanceOf[ASTNode].getText ==
"TOK_TABCOLNAME") ){
+ sys.error("Truncate tabel can not support columns")
--- End diff --
âtabelâ is a typo. I think it's better not to include this part here,
which would make the code not very clean. You can remove this part and fix
truncate column in another PR, or fix that in this PR.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]