Huawei-Spark / Spark-SQL-on-HBase

Native, optimized access to HBase Data through Spark SQL/Dataframe Interfaces
Apache License 2.0
321 stars 164 forks source link

something about HBasesqlParser how to realize #27

Closed yj-cheng closed 8 years ago

yj-cheng commented 8 years ago

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)
  }
xinyunh commented 8 years ago

@jackylk

jackylk commented 8 years ago

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.