diff --git a/src/Functions/array/arrayIndex.h b/src/Functions/array/arrayIndex.h index c38b8768645..dd1a8be7f25 100644 --- a/src/Functions/array/arrayIndex.h +++ b/src/Functions/array/arrayIndex.h @@ -660,6 +660,11 @@ struct ArrayIndexGenericNullImpl } }; +inline bool allowNested(const DataTypePtr & left, const DataTypePtr & right) +{ + return ((isNativeNumber(left) || isEnum(left)) && isNativeNumber(right)) || left->equals(*right); +} + inline bool allowArguments(const DataTypePtr & array_inner_type, const DataTypePtr & arg) { if (allowNested(array_inner_type, arg)) @@ -732,11 +737,6 @@ inline bool allowArguments(const DataTypePtr & array_inner_type, const DataTypeP return false; } -inline bool allowNested(const DataTypePtr & left, const DataTypePtr & right) -{ - return ((isNativeNumber(left) || isEnum(left)) && isNativeNumber(right)) || left->equals(*right); -} - template class FunctionArrayIndex : public IFunction {