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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…