Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-5213

Pluggable SQL Parser Support

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • SQL
    • None

    Description

      Currently, the SQL Parser dialect is hard code in SQLContext, which is not easy to extend, we need the features like:

      bin/spark-sql --driver-class-path customizedSQL92.jar
      
      -- switch to "hiveql" dialect
         spark-sql>SET spark.sql.dialect=hiveql;
         spark-sql>SELECT * FROM src LIMIT 1;
      
      -- switch to "sql" dialect
         spark-sql>SET spark.sql.dialect=sql;
         spark-sql>SELECT * FROM src LIMIT 1;
      
      -- register the new SQL dialect
         spark-sql> SET spark.sql.dialect.sql99=com.xxx.xxx.SQL99Dialect;
         spark-sql> SET spark.sql.dialect=sql99;
         spark-sql> SELECT * FROM src LIMIT 1;
      
      -- register the non-exist SQL dialect
         spark-sql> SET spark.sql.dialect.sql92=NotExistedClass;
         spark-sql> SET spark.sql.dialect=sql92;
         spark-sql> SELECT * FROM src LIMIT 1;
      -- Exception will be thrown and switch to dialect "sql" (for SQLContext) or "hiveql" (for HiveContext)
      

      Attachments

        Activity

          People

            chenghao Cheng Hao
            chenghao Cheng Hao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: