I'm saving Spark DataFrame using saveAsTable method and writing below code.
val options = Map("path" -> hiveTablePath)
df.write.format("orc")
.partitionBy("partitioncolumn")
.options(options)
.mode(SaveMode.Append)
.saveAsTable(hiveTable)
It's working fine and i am able to see data in hive table. but when I'm using one more property bucketby(5,bucketted_column)
df.write.format("orc")
.partitionBy("partitioncolumn")
.bucketby(5,bucketted_column)
.options(options)
.mode(SaveMode.Append)
.saveAsTable(hiveTable)
It's trying to save it in spark 'default' database instead of hive database.
can someone please suggest me why bucketby(5,bucketted_column) is not working with saveAsTable.
Note: Framework: HDP 3.0
Spark : 2.1