Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Jul 21, 2021
1 parent 87c3a1b commit 997f777
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
/** For Debug Use only
* List of test cases to test, in lower cases. */
protected def testList: Set[String] = Set(

"udf/postgreSQL/udf-aggregates_part1.sql"
)

/** List of test cases to ignore, in lower cases. */
Expand All @@ -167,7 +167,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
/** segfault, compilation error and exception */

"postgreSQL/window_part3.sql", // WindowSortKernel::Impl::GetCompFunction_
"subquery/in-subquery/in-joins.sql", // NullPointerException
"subquery/in-subquery/in-joins.sql", // NullPointerException: LocalTableScanExec.stringArgs
"udf/postgreSQL/udf-aggregates_part1.sql", // IllegalStateException: Value at index is null

/** Cannot reproduce */
Expand All @@ -192,7 +192,6 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
// "explain-aqe.sql", // plan check
// "explain.sql", // plan check
// "describe.sql", // AnalysisException
// "subquery/scalar-subquery/scalar-subquery-select.sql", // SMJ LeftAnti
// "ansi/decimalArithmeticOperations.sql",
// "postgreSQL/union.sql", // aggregate-groupby
// "postgreSQL/int4.sql", // exception expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession {
}
}

ignore(s"$testName using SortMergeJoin") {
test(s"$testName using SortMergeJoin") {
extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) =>
withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class ConditionedMergeJoinKernel::Impl {
auto streamed_relation = "sort_relation_" + std::to_string(relation_id_[1]) + "_";
auto left_index_name = "left_index_" + relation_id;
auto right_index_name = "right_index_" + relation_id;
auto outer_join_num_matches_name = "outer_join_num_matches_" + relation_id;
auto outer_join_num_matches_name = "outer_join_num_matches_" + relation_id;

///// Get Matched row /////
codes_ss << "int " << range_name << " = 0;" << std::endl;
Expand Down Expand Up @@ -453,7 +453,8 @@ class ConditionedMergeJoinKernel::Impl {
codes_ss << "int " << outer_join_num_matches_name << " = 0;" << std::endl;
codes_ss << "for (int " << range_id << " = 0; " << range_id << " < " << range_name
<< "; " << range_id << "++) {" << std::endl;
codes_ss << "if(" << function_name << "_res == 0" << ") {" << std::endl;
codes_ss << "if(" << function_name << "_res == 0"
<< ") {" << std::endl;
codes_ss << left_index_name << " = " << build_relation << "->GetItemIndexWithShift("
<< range_id << ");" << std::endl;
codes_ss << fill_null_name << " = false;" << std::endl;
Expand All @@ -466,9 +467,8 @@ class ConditionedMergeJoinKernel::Impl {
codes_ss << "if (!" << condition_name << "(" << left_index_name << ")) {"
<< std::endl;
}
codes_ss << "if ((" << range_id << " + 1) == " << range_name
<< " && " << outer_join_num_matches_name << " == 0) {"
<< std::endl;
codes_ss << "if ((" << range_id << " + 1) == " << range_name << " && "
<< outer_join_num_matches_name << " == 0) {" << std::endl;
codes_ss << fill_null_name << " = true; } else {" << std::endl;
codes_ss << "continue;" << std::endl;
codes_ss << "}}" << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1761,8 +1761,7 @@ SortArraysToIndicesKernel::SortArraysToIndicesKernel(

if (key_field_list.size() == 1 && result_schema->num_fields() == 1 &&
key_field_list[0]->type()->id() != arrow::Type::STRING &&
key_field_list[0]->type()->id() != arrow::Type::BOOL &&
!pre_processed_key_) {
key_field_list[0]->type()->id() != arrow::Type::BOOL && !pre_processed_key_) {
// Will use SortInplace when sorting for one non-string and non-boolean col
#ifdef DEBUG
std::cout << "UseSortInplace" << std::endl;
Expand Down
2 changes: 0 additions & 2 deletions native-sql-engine/cpp/src/third_party/datetime/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>&

#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
inline namespace literals {

CONSTCD11 date::day operator"" _d(unsigned long long d) NOEXCEPT;
CONSTCD11 date::year operator"" _y(unsigned long long y) NOEXCEPT;

Expand Down Expand Up @@ -1603,7 +1602,6 @@ inline std::basic_ostream<CharT, Traits>& operator<<(

#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
inline namespace literals {

CONSTCD11
inline date::day operator"" _d(unsigned long long d) NOEXCEPT {
return date::day{static_cast<unsigned>(d)};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
*
* contributor license agreements. See the NOTICE file distributed with
* contributor license agreements. See the NOTICE file distributed with
* this
* work for additional information regarding copyright ownership.
* work for additional information regarding copyright ownership.
* The ASF
* licenses this file to You under the Apache License, Version 2.0
* licenses this file to You under the Apache License, Version 2.0
* (the
* "License"); you may not use this file except in compliance with
* "License"); you may not use this file except in compliance with
* the
* License. You may obtain a copy of the License at
*
* License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by
* applicable law or agreed to in writing, software
* applicable law or agreed to in writing, software
* distributed under the
* License is distributed on an "AS IS" BASIS,
* License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied.
* CONDITIONS OF ANY KIND, either express or implied.
* See the License for the
* specific language governing permissions and
* specific language governing permissions and
* limitations under the
* License.
* License.
*/
#ifndef __NATIVE_MEMORY_H
#define __NATIVE_MEMORY_H
Expand Down

0 comments on commit 997f777

Please sign in to comment.