Commit a4db157
committed
Fix charset mismatch by overriding getDefaultCharset() with UTF-8
The previous fix patched createSqlType() for the no-arg and boolean
variants, but Calcite has many code paths for char type creation:
- createSqlType(SqlTypeName, int precision)
- RexBuilder.makeLiteral(String) → getDefaultCharset()
- RelBuilder.literal(String) → getDefaultCharset()
All of these bypassed the per-method overrides, causing residual
'VARCHAR CHARACTER SET UTF-8 is not comparable to CHAR(1)' errors
in RangeFormatter and other callers (e.g. bin command).
Fix: override getDefaultCharset() in OpenSearchTypeFactory to return
UTF-8. This is the single source of truth Calcite uses across all
char type creation paths, making every VARCHAR/CHAR consistently
UTF-8 without needing per-call patches.
The per-method createSqlType overrides are removed as redundant.
Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>1 parent 4c7bf03 commit a4db157
1 file changed
Lines changed: 6 additions & 14 deletions
Lines changed: 6 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 113 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 114 | + | |
123 | 115 | | |
124 | 116 | | |
125 | 117 | | |
| |||
0 commit comments