Prevent adding redundant casts
@@ -568,7 +568,7 @@ class RelationPlanner
Symbol inputSymbol = oldSymbols.get(i);
Type inputType = symbolAllocator.getTypes().get(inputSymbol);
Type outputType = targetColumnTypes[i];
- if (outputType != inputType) {
+ if (!outputType.equals(inputType)) {
Expression cast = new Cast(inputSymbol.toSymbolReference(), outputType.getTypeSignature().toString());
Symbol outputSymbol = symbolAllocator.newSymbol(cast, outputType);
assignments.put(outputSymbol, cast);
