Skip to main content
Question

Huge Switch Code - GI Runs our of Spark Space

  • February 5, 2026
  • 1 reply
  • 28 views

Forum|alt.badge.img

I have a huge section of code. It’s job is to assign a shipping zone, that represents an orders USDA Hardiness Zone, based on the shipping zip code. Even with condensing zip codes the code is still 17,000 cases long.

An import scenario cannot handle this amount of code either.

Any ideas on how to approach this?  

My original idea was to create the GI to put the USDA Zone in a field and then use the GI as an import data source.

1 reply

abhimanyuprajapati52
Jr Varsity I
Forum|alt.badge.img

@SBaldwin ,

Since the switch logic is essentially lookup data, you may want to avoid computing it in GI altogether. Storing ZIP-to-zone mapping in a dedicated table and referencing it via BQL, a projection, or direct join would prevent Spark-heavy evaluation and scale much better than evaluating thousands of cases inside a GI formula.