Skip to content

Commit

Permalink
change hbase dbSpliter from / to :
Browse files Browse the repository at this point in the history
  • Loading branch information
latincross committed Jan 9, 2019
1 parent 8b6bcd1 commit b49cbd3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MLSQLHbase extends MLSQLSource with MLSQLSink with MLSQLSourceInfo with ML

override def shortFormat: String = "hbase"

override def dbSplitter: String = "/"
override def dbSplitter: String = ":"

override def load(reader: DataFrameReader, config: DataSourceConfig): DataFrame = {
val Array(_dbname, _dbtable) = if (config.path.contains(dbSplitter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class HbaseSpec extends BasicSparkOperation with SpecFunctions with BasicMLSQLCo
|connect hbase where `zk`="127.0.0.1:2181"
|and `family`="cf" as hbase1;
|
|load hbase.`hbase1/mlsql_example`
|load hbase.`hbase1:mlsql_example`
|as mlsql_example;
|
|select * from mlsql_example as show_data;
|
|
|select '2' as rowkey, 'insert test data' as name as insert_table;
|
|save insert_table as hbase.`hbase1/mlsql_example`;
|save insert_table as hbase.`hbase1:mlsql_example`;
|
""".stripMargin, sq)
assume(spark.sql("select * from mlsql_example where rowkey='2' ").collect().last.get(0) == "2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,14 @@ class DslSpec extends BasicSparkOperation with SpecFunctions with BasicMLSQLConf
"""
|connect hbase where
| namespace="test_ns"
|and zk="hbase-docker:2181" as hbase_instance;
|and zk="127.0.0.1:2181" as hbase_instance;
|
|load hbase.`hbase_instance:test_tb` options
|family="cf"
|as test_table;
|
|load hbase.`test_ns_1:test_tb_1`
|options zk="hbase-docker:2181"
|options zk="127.0.0.1:2181"
|and family="cf"
|as output1;
|
Expand Down

0 comments on commit b49cbd3

Please sign in to comment.