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

chore: Fix warnings in both compiler and test environments #164

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

advancedxy
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

When build comet locally, I noticed various warnings. Some are compiler warnings, some are test environment warnings.
Related code should be refactored for better code quality

What changes are included in this PR?

Fixes various warning in the compiler and test environments

How are these changes tested?

Manually verify the output of maven test

@@ -517,6 +517,7 @@ public void close() throws IOException {
}
}

@SuppressWarnings("deprecation")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileSystem.getAllStatistics is deprecated.

@@ -99,6 +99,7 @@ const LOG_PATTERN: &str = "{d(%y/%m/%d %H:%M:%S)} {l} {f}: {m}{n}";
// Creates a default log4rs config, which logs to console with `INFO` level.
fn default_logger_config() -> CometResult<Config> {
let console_append = ConsoleAppender::builder()
.target(Target::Stderr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging to stderr, so that surefire will not complain about: Corrupted channel by directly writing to native stream in forked JVM.

@@ -711,9 +711,9 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<systemProperties>
<systemPropertyVariables>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemProperties is deprecated.

@@ -115,7 +115,7 @@ class CometSparkSessionExtensions
// data source V1
case scanExec @ FileSourceScanExec(
HadoopFsRelation(_, partitionSchema, _, _, _: ParquetFileFormat, _),
_: Seq[AttributeReference],
_: Seq[_],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type erasure.

_: StringType,
"readSidePadding",
arguments,
_,
true,
false,
true) if arguments.size == 2 =>
true) if clz == classOf[CharVarcharCodegenUtils] && arguments.size == 2 =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type erasure. Should check clz instead.

@@ -29,6 +27,8 @@ import org.apache.spark.sql.execution.{ColumnarToRowExec, SparkPlan, UnaryExecNo
import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics, SQLShuffleReadMetricsReporter, SQLShuffleWriteMetricsReporter}
import org.apache.spark.sql.vectorized.ColumnarBatch

import com.google.common.base.Objects
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was wrong to use java.util.Objects

@@ -271,7 +271,7 @@ class CometTPCHQuerySuite extends QueryTest with CometTPCBase with SQLQueryTestH
}

// TODO: remove once Spark 3.2 & 3.3 is no longer supported
private val shouldRegenerateGoldenFiles: Boolean =
private def shouldRegenerateGoldenFiles: Boolean =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forward reference in L227, which is incorrect in runtime.

@advancedxy
Copy link
Contributor Author

cc @sunchao @viirya

@sunchao sunchao merged commit 72398a6 into apache:main Mar 4, 2024
20 checks passed
@sunchao
Copy link
Member

sunchao commented Mar 4, 2024

Merged, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants