[jOOQ/jOOQ#18827] Missing VARCHAR lengths in Databricks generated code

This commit is contained in:
Lukas Eder 2025-08-06 14:16:55 +02:00
parent 24e6a7b36d
commit 0bbabb7a48

View File

@ -11983,6 +11983,16 @@ public class JavaGenerator extends AbstractGenerator {
if (d != null)
dataType = dataType.defaultValue((Field) DSL.field(d, dataType));
// [#18827] In some cases, we can't report the length/precision/scale from jOOQ-meta
// as it isn't encoded formally in the INFORMATION_SCHEMA (e.g. array component type length),
// but it's available in text form
if (dataType.precisionDefined() && precision == 0)
precision = dataType.precision();
if (dataType.scaleDefined() && scale == 0)
scale = dataType.scale();
if (dataType.lengthDefined() && length == 0)
length = dataType.length();
// If there is a standard SQLDataType available for the dialect-
// specific DataType t, then reference that one.
if (dataType.getSQLDataType() != null && sb.length() == 0) {