Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-1632][CH]Daily Update Clickhouse Version (20240104) #4272

Merged
merged 4 commits into from
Jan 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class GlutenClickHouseTPCDSParquetAQESuite
| where ss_quantity between 1 and 20
| and ss_sold_date_sk = 2452635
|""".stripMargin) { _ => }
assert(result(0).getDouble(0) == 379.21313271604936)
AlmostEqualsIsRel(379.21313271604936, result.head.getDouble(0), DBL_RELAX_EPSILON)
}

test("test select avg(int), avg(long)") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GlutenClickHouseTPCDSParquetColumnarShuffleAQESuite
| where ss_quantity between 1 and 20
| and ss_sold_date_sk = 2452635
|""".stripMargin) { _ => }
assert(result(0).getDouble(0) == 379.21313271604936)
AlmostEqualsIsRel(379.21313271604936, result.head.getDouble(0), DBL_RELAX_EPSILON)
}

test("test select avg(int), avg(long)") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GlutenClickHouseTPCDSParquetColumnarShuffleSuite extends GlutenClickHouseT
| where ss_quantity between 1 and 20
| and ss_sold_date_sk = 2452635
|""".stripMargin) { _ => }
assert(result(0).getDouble(0) == 379.21313271604936)
AlmostEqualsIsRel(379.21313271604936, result.head.getDouble(0), DBL_RELAX_EPSILON)
}

test("test select avg(int), avg(long)") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class GlutenClickHouseTPCDSParquetSuite extends GlutenClickHouseTPCDSAbstractSui
| where ss_quantity between 1 and 20
| and ss_sold_date_sk = 2452635
|""".stripMargin) { _ => }
assert(result(0).getDouble(0) == 379.21313271604936)
AlmostEqualsIsRel(379.21313271604936, result.head.getDouble(0), DBL_RELAX_EPSILON)
}

test("test select avg(int), avg(long)") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@
*/
package io.glutenproject.execution

abstract class GlutenClickHouseWholeStageTransformerSuite extends WholeStageTransformerSuite {}
abstract class GlutenClickHouseWholeStageTransformerSuite extends WholeStageTransformerSuite {

val DBL_EPSILON = 2.2204460492503131e-16
val DBL_RELAX_EPSILON: Double = Math.pow(10, -11)
val FLT_EPSILON = 1.19209290e-07f
def AlmostEqualsIsRel(expected: Double, actual: Double, EPSILON: Double = DBL_EPSILON): Unit = {
val diff = Math.abs(expected - actual)
val epsilon = EPSILON * Math.max(Math.abs(expected), Math.abs(actual))
if (diff > epsilon) {
fail(s"""
|expected: $expected
|actual: $actual
| abs(expected-expected) ~ epsilon = $diff ~ $epsilon
|""".stripMargin)
}
}
}
4 changes: 2 additions & 2 deletions cpp-ch/clickhouse.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CH_ORG=Kyligence
CH_BRANCH=rebase_ch/20240103
CH_COMMIT=9c039962813
CH_BRANCH=rebase_ch/20240104
CH_COMMIT=7ed09d2c7ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ OptimizedParquetBlockInputFormat::OptimizedParquetBlockInputFormat(ReadBuffer &
{
}

Chunk OptimizedParquetBlockInputFormat::generate()
Chunk OptimizedParquetBlockInputFormat::read()
{
Chunk res;
block_missing_values.clear();
Expand All @@ -62,7 +62,7 @@ Chunk OptimizedParquetBlockInputFormat::generate()
std::shared_ptr<arrow::Table> table;
arrow::Status read_status = file_reader->ReadRowGroup(row_group_current, column_indices, &table);
if (!read_status.ok())
throw ParsingException(ErrorCodes::CANNOT_READ_ALL_DATA, "Error while reading Parquet data: {}", read_status.ToString());
throw Exception(ErrorCodes::CANNOT_READ_ALL_DATA, "Error while reading Parquet data: {}", read_status.ToString());

if (format_settings.use_lowercase_column_name)
table = *table->RenameColumns(column_names);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OptimizedParquetBlockInputFormat : public IInputFormat
const BlockMissingValues & getMissingValues() const override;

private:
Chunk generate() override;
Chunk read() override;

protected:
void prepareReader();
Expand Down
1 change: 1 addition & 0 deletions cpp-ch/local-engine/tests/gtest_ch_join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ TEST(TestJoin, StorageJoinFromReadBufferTest)
auto table_join = std::make_shared<TableJoin>(SizeLimits(), false, JoinKind::Left, JoinStrictness::All, cols);
auto join_storage = std::shared_ptr<StorageJoinFromReadBuffer>(new StorageJoinFromReadBuffer( // NOLINT
*in,
2048, // Even if you don't know the number of rows, passing an arbitrary value is fine
cols,
false,
table_join,
Expand Down
Loading