Skip to content

Commit c316830

Browse files
fix cluster col limit appliction
1 parent 5e5892f commit c316830

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bigframes/session/bq_caching_executor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,19 @@ def _execute_plan_gbq(
623623

624624
create_table = True
625625
if not cache_spec.cluster_cols:
626-
assert len(cache_spec.cluster_cols) <= _MAX_CLUSTER_COLUMNS
626+
627627
offsets_id = bigframes.core.identifiers.ColumnId(
628628
bigframes.core.guid.generate_guid()
629629
)
630630
plan = nodes.PromoteOffsetsNode(plan, offsets_id)
631631
cluster_cols = [offsets_id.sql]
632632
else:
633-
cluster_cols = cache_spec.cluster_cols
633+
cluster_cols = [
634+
col
635+
for col in cache_spec.cluster_cols
636+
if bigframes.dtypes.is_clusterable(plan.schema.get_type(col))
637+
]
638+
cluster_cols = cluster_cols[:_MAX_CLUSTER_COLUMNS]
634639

635640
compiled = compile.compile_sql(
636641
compile.CompileRequest(

0 commit comments

Comments
 (0)