Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ header:
- '**/*.md5'
- '**/*.patch'
- '**/*.log'
- '**/*.sql'
- 'tsan_suppressions'
- 'docs/.markdownlintignore'
- 'fe/fe-core/src/test/resources/data/net_snmp_normal'
Expand All @@ -52,8 +53,6 @@ header:
- 'be/src/util/sse2neon.h'
- 'be/src/util/utf8_check.cpp'
- 'build-support/run_clang_format.py'
- 'regression-test/common'
- 'regression-test/suites'
- 'regression-test/data'

comment: on-failure
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.apache.doris.rewrite.RewriteBinaryPredicatesRule;
import org.apache.doris.rewrite.RewriteEncryptKeyRule;
import org.apache.doris.rewrite.RewriteFromUnixTimeRule;
import org.apache.doris.rewrite.RewriteLikePredicateRule;
import org.apache.doris.rewrite.RewriteDateLiteralRule;
import org.apache.doris.rewrite.mvrewrite.CountDistinctToBitmap;
import org.apache.doris.rewrite.mvrewrite.CountDistinctToBitmapOrHLLRule;
Expand Down Expand Up @@ -311,7 +310,6 @@ public GlobalState(Catalog catalog, ConnectContext context) {
rules.add(RewriteDateLiteralRule.INSTANCE);
rules.add(RewriteEncryptKeyRule.INSTANCE);
rules.add(RewriteAliasFunctionRule.INSTANCE);
rules.add(RewriteLikePredicateRule.INSTANCE);
List<ExprRewriteRule> onceRules = Lists.newArrayList();
onceRules.add(ExtractCommonFactorsRule.INSTANCE);
onceRules.add(InferFiltersRule.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ protected void toThrift(TExprNode msg) {
@Override
public void analyzeImpl(Analyzer analyzer) throws AnalysisException {
super.analyzeImpl(analyzer);
if (!getChild(0).getType().isStringType() && !getChild(0).getType().isFixedPointType()
&& !getChild(0).getType().isNull()) {
if (getChild(0).getType().isObjectStored()) {
throw new AnalysisException(
"left operand of " + op.toString() + " must be of type STRING or FIXED_POINT_TYPE: " + toSql());
"left operand of " + op.toString() + " must not be Bitmap or HLL: " + toSql());
}
if (!getChild(1).getType().isStringType() && !getChild(1).getType().isNull()) {
throw new AnalysisException(
"right operand of " + op.toString() + " must be of type STRING: " + toSql());
throw new AnalysisException("right operand of " + op.toString() + " must be of type STRING: " + toSql());
}

if (!getChild(0).getType().isStringType()) {
uncheckedCastChild(Type.VARCHAR, 0);
}

fn = getBuiltinFunction(analyzer, op.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,12 @@ public void addBuiltinBothScalaAndVectorized(Function fn) {
vecFns = Lists.newArrayList();
vectorizedFunctions.put(fn.functionName(), vecFns);
}
ScalarFunction scalarFunction = (ScalarFunction)fn;
vecFns.add(ScalarFunction.createVecBuiltin(scalarFunction.functionName(), scalarFunction.getSymbolName(),
Lists.newArrayList(scalarFunction.getArgs()), scalarFunction.hasVarArgs(),
scalarFunction.getReturnType(), scalarFunction.isUserVisible(), scalarFunction.getNullableMode()));
ScalarFunction scalarFunction = (ScalarFunction) fn;
vecFns.add(ScalarFunction.createVecBuiltin(scalarFunction.functionName(), scalarFunction.getPrepareFnSymbol(),
scalarFunction.getSymbolName(), scalarFunction.getCloseFnSymbol(),
Lists.newArrayList(scalarFunction.getArgs()), scalarFunction.hasVarArgs(),
scalarFunction.getReturnType(), scalarFunction.isUserVisible(),
scalarFunction.getNullableMode()));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,22 @@ public static ScalarFunction createBuiltin(

public static ScalarFunction createVecBuiltinOperator(
String name, String symbol, ArrayList<Type> argTypes, Type retType, NullableMode nullableMode) {
return createVecBuiltin(name, symbol, argTypes, false, retType, false, nullableMode);
return createVecBuiltin(name, null, symbol, null, argTypes, false, retType, false, nullableMode);
}

//TODO: This method should not be here, move to other place in the future
public static ScalarFunction createVecBuiltin(
String name, String symbol, ArrayList<Type> argTypes,
boolean hasVarArgs, Type retType, boolean userVisible, NullableMode nullableMode) {
ScalarFunction fn = new ScalarFunction(
new FunctionName(name), argTypes, retType, hasVarArgs, userVisible, true);
public static ScalarFunction createVecBuiltin(String name, String prepareFnSymbolBName, String symbol,
String closeFnSymbolName, ArrayList<Type> argTypes, boolean hasVarArgs, Type retType, boolean userVisible,
NullableMode nullableMode) {
ScalarFunction fn = new ScalarFunction(new FunctionName(name), argTypes, retType, hasVarArgs, userVisible,
true);
if (prepareFnSymbolBName != null) {
fn.prepareFnSymbol = prepareFnSymbolBName;
}
fn.symbolName = symbol;
if (closeFnSymbolName != null) {
fn.closeFnSymbol = closeFnSymbolName;
}
fn.nullableMode = nullableMode;
return fn;
}
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions regression-test/common/load/test_basic_agg.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
insert into test_basic_agg values(0,0,0,0,0,'0',0,0,0,0,0);
26 changes: 26 additions & 0 deletions regression-test/common/table/test_basic_agg.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE `test_basic_agg` (
`k1` tinyint(4) NULL COMMENT "",
`k2` smallint(6) NULL COMMENT "",
`k3` int(11) NULL COMMENT "",
`k4` bigint(20) NULL COMMENT "",
`k5` decimal(9, 3) NULL COMMENT "",
`k6` char(5) NULL COMMENT "",
`k10` date NULL COMMENT "",
`k11` datetime NULL COMMENT "",
`k7` varchar(20) NULL COMMENT "",
`k8` double MAX NULL COMMENT "",
`k9` float SUM NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`)
COMMENT "OLAP"
PARTITION BY RANGE(`k1`)
(PARTITION p1 VALUES [("-128"), ("-64")),
PARTITION p2 VALUES [("-64"), ("0")),
PARTITION p3 VALUES [("0"), ("64")),
PARTITION p4 VALUES [("64"), (MAXVALUE)))
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select_default --
1

-- !select_default2 --
1

-- !select_default3 --

-- !select_default4 --

-- !select_default --
1

-- !select_default2 --
1

-- !select_default3 --

-- !select_default4 --

19 changes: 18 additions & 1 deletion regression-test/suites/correctness/test_select_constant.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("test_select_constant") {
qt_select1 'select 100, "test", date("2021-01-02")'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
suite("test_select_with_predicate_like") {
def tables=["test_basic_agg"]

for (String table in tables) {
sql """drop table if exists ${table};"""
sql new File("""regression-test/common/table/${table}.sql""").text
sql new File("""regression-test/common/load/${table}.sql""").text
}


qt_select_default "select 1 from test_basic_agg where 1998 like '1%';"
qt_select_default2 "select 1 from test_basic_agg where '1998' like '1%';"
qt_select_default3 "select 1 from test_basic_agg where 2998 like '1%';"
qt_select_default4 "select 1 from test_basic_agg where '2998' like '1%';"
qt_select_default "select 1 from test_basic_agg where 199.8 like '1%';"
qt_select_default2 "select 1 from test_basic_agg where '199.8' like '1%';"
qt_select_default3 "select 1 from test_basic_agg where 299.8 like '1%';"
qt_select_default4 "select 1 from test_basic_agg where '299.8' like '1%';"
}
17 changes: 17 additions & 0 deletions regression-test/suites/demo/connect_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("connect_action", "demo") {
logger.info("ok")
def result1 = connect(user = 'admin', password = context.config.jdbcPassword, url = context.config.jdbcUrl) {
Expand Down
17 changes: 17 additions & 0 deletions regression-test/suites/demo/event_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("event_action", "demo") {
def createTable = { tableName ->
sql """
Expand Down
17 changes: 17 additions & 0 deletions regression-test/suites/demo/explain_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("explain_action", "demo") {
explain {
sql("select 100")
Expand Down
17 changes: 17 additions & 0 deletions regression-test/suites/demo/lazyCheck_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("lazyCheck_action_exceptions", "demo") {
/***** 1. lazy check exceptions *****/

Expand Down
17 changes: 17 additions & 0 deletions regression-test/suites/demo/qt_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("qt_action", "demo") {
/**
* qt_xxx sql equals to quickTest(xxx, sql) witch xxx is tag.
Expand Down
17 changes: 17 additions & 0 deletions regression-test/suites/demo/select_union_all_action.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("select_union_all_action", "demo") {
// 3 rows and 1 column
def rows = [3, 1, 10]
Expand Down
Loading