Write to Hive bucketed tables
Type of change: Property/Spark SQL changes
By default, you can write to Hive bucketed tables.
By default, you cannot write to Hive bucketed tables.
The code above will throw the following error:
org.apache.spark.sql.AnalysisException: Output Hive table `hive_test_db`.`test_bucketing` is bucketed but Spark currently does NOT populate bucketed output which is compatible with Hive.
To write to a Hive bucketed table, you must use
hive.enforce.sorting=false to forego bucketing guarantees.