Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
147 views
in Technique[技术] by (71.8m points)

Error to save Hbase data in Spark Java with JavaSession

My code is in "Java Spark" and I need resolve a problem in the last line.

Calendario calendario = new Calendario();
Dataset<Row> test = spark.createDataFrame(Arrays.asList(
new Calendario("999", "2"),
new Calendario("888", "2"),
new Calendario("777", "2")
), Calendario.class);

String catalog = "{
" + ""table":{"namespace":"default", "name":"novatabela"},
" + ""rowkey":"key",
"
+ ""columns":{
" + ""rowKey":{"cf":"rowkey", "col":"key", "type":"string"},
"
+ ""tipoNi":{"cf":"c", "col":"campoA", "type":"string"},
"
+ ""ni":{"cf":"c", "col":"campoB", "type":"string"},
" 
+ "}}";

Map<String, String> optionsMap = new HashMap();
optionsMap.put(HBaseTableCatalog.tableCatalog(), catalog);
optionsMap.put(HBaseTableCatalog.newTable(), "5");
System.out.println(catalog); 
System.out.println(optionsMap);     
        
test.write().options(optionsMap).format("org.apache.spark.sql.execution.datasources.hbase").save();

I receive the error:

Exception in thread "main" java.lang.IllegalArgumentException: Can not create a Path from a null string

question from:https://stackoverflow.com/questions/65878941/error-to-save-hbase-data-in-spark-java-with-javasession

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...