diff --git a/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java b/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java index c2b8400bd..e57c19927 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -237,7 +237,8 @@ private RelDataType getUnionDataType(final List dataTypes) { if (baseDataType.isStruct()) { // Build the common UNION type using the first branch that appears in the query final RelDataTypeFactory.Builder builder = - new RelDataTypeFactory.Builder(toRelConverter.getRelBuilder().getTypeFactory()); + new RelDataTypeFactory.Builder(toRelConverter.getRelBuilder().getTypeFactory()) + .kind(baseDataType.getStructKind()); // Build a set of common fields by name in the given dataTypes Set commonFieldNames =