jackylee-ch opened a new pull request, #10196:
URL: https://github.com/apache/paimon/pull/10196

   ## Purpose
   
   `SparkZOrderUDF.sortedLexicographically` dispatches on the column type and
   throws `Cannot use column ... of type ... in ZOrdering, the type is
   unsupported` for anything it does not list. `DecimalType` is not listed, so
   `compact(..., order_strategy => 'zorder', order_by => '<decimal>')` 
hard-fails
   on a decimal column, while `SparkHilbertUDF` — the sibling clustering 
strategy
   in the same package — already clusters decimals. The two strategies disagree
   on a common type.
   
   ## Change
   
   Handle `DecimalType` in the z-order dispatch the same way Hilbert does, and 
the
   way z-order already handles timestamp/date: cast to long and order that. The
   long key is a coarse clustering hint, which is all z-order needs.
   
   ## Tests
   
   `SparkZOrderUDFTest.testDecimalColumnIsSupported` z-orders a decimal column
   with a null and asserts the null maps to the zero sentinel while the non-null
   z-values rise with the value. It throws "the type is unsupported" without the
   change.
   
   Written with Claude Code; verification is mine.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to