Huawei-Spark/Spark-SQL-on-HBase

something about HBasesqlParser how to realize

yj-cheng opened this issue · 2 comments

When I read the part of HBaseSQlCLIDriver,I didn't understand something about HBasesqlParser how to realize.

//只知道这一块的功能是获取SQL语句关键字解析的操作如何解析部分理解的不是很明白

def getCompletors: Seq[Completor] = {
    val sc: SimpleCompletor = new SimpleCompletor(new Array[String](0))
    // add keywords, including lower-cased versions
    HBaseSQLParser.getKeywords.foreach { kw =>  //遍历每个SQL关键字进行了什么操作?
      sc.addCandidateString(kw)
      sc.addCandidateString(kw.toLowerCase)
    }

    Seq(sc)
  }

It is used for word completion in hbasesql CLI. All key words should be added to the SimpleCompletor.
By the way, now astro has been moved to new repository: http://github.com/huaweibigdata/astro, please feel free to ask questions in issue section in this new repository.