Skip to content

Commit

Permalink
support TOK_CHARSETLITERAL in HiveQl
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wang committed Feb 10, 2015
1 parent bd0b5ea commit 606f981
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
"inputddl2",
"inputddl3",
"inputddl4",
"inputddl5",
"inputddl6",
"inputddl7",
"inputddl8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package org.apache.spark.sql.hive

import java.sql.Date
import org.apache.commons.codec.binary.Hex

import scala.collection.mutable.ArrayBuffer

import org.apache.hadoop.hive.conf.HiveConf
Expand Down Expand Up @@ -1237,6 +1239,9 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
case ast: ASTNode if ast.getType == HiveParser.TOK_DATELITERAL =>
Literal(Date.valueOf(ast.getText.substring(1, ast.getText.length - 1)))

case ast: ASTNode if ast.getType == HiveParser.TOK_CHARSETLITERAL =>
Literal(BaseSemanticAnalyzer.charSetString(ast.getChild(0).getText, ast.getChild(1).getText))

case a: ASTNode =>
throw new NotImplementedError(
s"""No parse rules for ASTNode type: ${a.getType}, text: ${a.getText} :
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name string
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
邵铮
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1

0 comments on commit 606f981

Please sign in to comment.