Skip to content

Commit cad8db5

Browse files
committed
fix varchar
1 parent 446550f commit cad8db5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sqlglot/optimizer/annotate_types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ def _get_scope_selects(self, scope: Scope) -> dict[str, dict[str, t.Any]]:
346346
if alias_node:
347347
col_types[field_col.name] = alias_node.type
348348
else:
349-
col_types[field_col.name] = exp.DType.VARCHAR
349+
col_types[field_col.name] = exp.DataType.build(
350+
"VARCHAR", dialect=self.dialect
351+
)
350352

351353
# Value column types from the IN source columns
352354
src = first.this if is_pivot_alias else first

0 commit comments

Comments
 (0)