Naitree Zhu created HBASE-24276:
-----------------------------------

             Summary: hbase spark connector doesn't support writing to table 
not in default namespace
                 Key: HBASE-24276
                 URL: https://issues.apache.org/jira/browse/HBASE-24276
             Project: HBase
          Issue Type: Bug
          Components: hbase-connectors, spark
    Affects Versions: connector-1.0.0
         Environment: - HBase 2.2.4
- Hadoop 2.10.0
- Spark 2.4.5
            Reporter: Naitree Zhu


Defining the following table catalog:

{code:java}
val catalog = """{
  |"table": {"namespace": "ns1", "name": "test1"},
  |"rowkey": "id",
  |"columns": {
    |"id": {"cf": "rowkey", "col": "id", "type": "string"}, 
    |"x": {"cf": "d", "col": "xxx", "type": "int"}
  |}
|}""".stripMargin
{code}

Try to write some test data to {{ns1:test1}} table using spark:

{code:java}
val df = Seq(("abc", 1), ("def", 2)).toDF("id", "x")
df.write.options(Map(HBaseTableCatalog.tableCatalog -> catalog, 
"hbase.spark.use.hbasecontext" -> "false", HBaseTableCatalog.newTable-> 
"5")).format("org.apache.hadoop.hbase.spark").save()
{code}

After executing the code above, I found out that the test data was written to 
{{default:test1}}, rather than {{ns1:test1}}.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to