All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.mlsql.dsl.processor.GrammarProcessListener.scala Maven / Gradle / Ivy

The newest version!
package tech.mlsql.dsl.processor

import org.apache.spark.sql.SparkSession
import streaming.dsl.ScriptSQLExecListener
import streaming.dsl.parser.DSLSQLParser.SqlContext
import tech.mlsql.dsl.adaptor.SelectGrammarAdaptor

/**
  * 2019-04-12 WilliamZhu([email protected])
  */
class GrammarProcessListener(val sqel: ScriptSQLExecListener, _sparkSession: SparkSession, _defaultPathPrefix: String, _allPathPrefix: Map[String, String]) extends ScriptSQLExecListener(_sparkSession, _defaultPathPrefix, _allPathPrefix) {
  def this(sqel: ScriptSQLExecListener) {
    this(sqel, null, null, null)
  }

  override def exitSql(ctx: SqlContext): Unit = {
    ctx.getChild(0).getText.toLowerCase() match {
      case "select" =>
        new SelectGrammarAdaptor(this).parse(ctx)
      case _ =>
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy