Skip to content

Commit 2ee20cf

Browse files
committed
Use more acurate condition than isNumeric
1 parent ac3c936 commit 2ee20cf

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/Functions/GatherUtils/Algorithms.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,10 @@ inline void checkAreLowCardinalityInsertable(const Source & source, const Generi
692692
const bool can_insert =
693693
// Check same type
694694
source_elements.structureEquals(sink.elements)
695-
// insertRangeFrom casts numeric types if they are different, so it can insert them.
696-
|| (sink.elements.lowCardinality()
697-
&& source_elements.lowCardinality()
698-
&& sink.elements.isNumeric()
699-
&& source_elements.isNumeric());
695+
// insertRangeFrom casts numeric types if they are different, so it can insert them.
696+
|| (source_elements.lowCardinality() &&
697+
sink.elements.lowCardinality() &&
698+
(source_elements.getDataType() == sink.elements.getDataType()));
700699

701700
if (!can_insert)
702701
throw Exception(ErrorCodes::LOGICAL_ERROR,

0 commit comments

Comments
 (0)