BucketSpec¶
BucketSpec is the bucketing specification of a table (the metadata of a bucketed table).
BucketSpec is a SQLConfHelper
Creating Instance¶
BucketSpec takes the following to be created:
- Number of buckets
- Bucketing Columns
- Sorting Columns
BucketSpec is created when:
CatalogUtilsis requested to normalizeBucketSpecAstBuilderis requested to parse bucketing specificationTransformHelperis requested to convertTransformsHiveExternalCatalogis requested to restoreTableMetadata (and getBucketSpecFromTableProperties)HiveClientImplis requested to convertHiveTableToCatalogTableDataFrameWriteris requested for the BucketSpecShowCreateTableExecis requested to showTablePartitioning
Number of Buckets¶
BucketSpec is given the number of buckets when created.
The number of buckets has to be between 0 and spark.sql.sources.bucketing.maxBuckets (inclusive) or an AnalysisException is reported:
Number of buckets should be greater than 0 but less than or equal to bucketing.maxBuckets (`[bucketingMaxBuckets]`). Got `[numBuckets]`.