You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2024/04/28 11:45:02 UTC
[PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
panbingkun opened a new pull request, #46264:
URL: https://github.com/apache/spark/pull/46264
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584009804
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:
##########
@@ -233,7 +233,7 @@ class FileScanRDD(
if (files.hasNext) {
currentFile = files.next()
updateMetadataRow()
- logInfo(s"Reading File $currentFile")
+ logInfo(log"Reading File ${MDC(PARTITIONED_FILE, currentFile)}")
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582471773
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala:
##########
@@ -39,7 +39,7 @@ class FilePartitionReader[T](
if (currentReader == null) {
if (files.hasNext) {
val file = files.next()
- logInfo(s"Reading file $file")
+ logInfo(log"Reading file ${MDC(PARTITIONED_FILE, file)}")
Review Comment:
The class of `file` is `PartitionedFile`, So `LogKeys.PATH` is not used
https://github.com/apache/spark/blob/8c446f35dc038e92ddc36f375c304a8879ac6f5f/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala#L70-L72
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583677567
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FilePartition.scala:
##########
@@ -99,7 +99,7 @@ object FilePartition extends Logging {
val desiredSplitBytes =
(totalSizeInBytes / BigDecimal(maxPartNum.get)).setScale(0, RoundingMode.UP).longValue
val desiredPartitions = getFilePartitions(partitionedFiles, desiredSplitBytes, openCostBytes)
- logWarning(log"The number of partitions is ${MDC(PARTITIONS_SIZE, partitions.size)}, " +
+ logWarning(log"The number of partitions is ${MDC(COUNT, partitions.size)}, " +
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584012516
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -717,14 +716,15 @@ case class RepairTableCommand(
evalPool.shutdown()
}
val total = partitionSpecsAndLocs.length
- logInfo(s"Found $total partitions in $root")
+ logInfo(log"Found ${MDC(LogKeys.TOTAL, total)} partitions in ${MDC(LogKeys.PATH, root)}")
val partitionStats = if (spark.sessionState.conf.gatherFastStats) {
gatherPartitionStats(spark, partitionSpecsAndLocs, fs, pathFilter, threshold)
} else {
Map.empty[Path, PartitionStatistics]
}
- logInfo(s"Finished to gather the fast stats for all $total partitions.")
+ logInfo(log"Finished to gather the fast stats for all ${MDC(LogKeys.TOTAL, total)} " +
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang closed pull request #46264: [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework
URL: https://github.com/apache/spark/pull/46264
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583678360
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:
##########
@@ -233,7 +233,7 @@ class FileScanRDD(
if (files.hasNext) {
currentFile = files.next()
updateMetadataRow()
- logInfo(s"Reading File $currentFile")
+ logInfo(log"Reading File ${MDC(PARTITIONED_FILE, currentFile)}")
Review Comment:
CURRENT_FILE seems better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on PR #46264:
URL: https://github.com/apache/spark/pull/46264#issuecomment-2083603285
LGTM except for a few minor comments on the names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582474060
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala:
##########
@@ -494,7 +495,7 @@ object DataSourceStrategy
val partitionSet = AttributeSet(partitionColumns)
val predicates = ExpressionSet(normalizedFilters
.flatMap(extractPredicatesWithinOutputSet(_, partitionSet)))
- logInfo(s"Pruning directories with: ${predicates.mkString(",")}")
+ logInfo(log"Pruning directories with: ${MDC(PREDICATES, predicates.mkString(","))}")
Review Comment:
I'm not sure if `EXPRS` is more general.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584012961
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala:
##########
@@ -137,9 +138,8 @@ object FileSourceStrategy extends Strategy with PredicateHelper with Logging {
val numBucketsSelected = matchedBuckets.cardinality()
- logInfo {
- s"Pruned ${numBuckets - numBucketsSelected} out of $numBuckets buckets."
- }
+ logInfo(log"Pruned ${MDC(COUNT, numBuckets - numBucketsSelected)} " +
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583689079
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala:
##########
@@ -39,7 +39,7 @@ class FilePartitionReader[T](
if (currentReader == null) {
if (files.hasNext) {
val file = files.next()
- logInfo(s"Reading file $file")
+ logInfo(log"Reading file ${MDC(PARTITIONED_FILE, file)}")
Review Comment:
CURRENT_FILE
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583656912
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -276,31 +299,40 @@ object LogKeys {
case object NUM_FILES_REUSED extends LogKey
case object NUM_FREQUENT_ITEMS extends LogKey
case object NUM_ITERATIONS extends LogKey
+ case object NUM_LEFT_PARTITION_VALUES extends LogKey
+ case object NUM_LOADED_ENTRIES extends LogKey
case object NUM_LOCAL_FREQUENT_PATTERN extends LogKey
case object NUM_PARTITION extends LogKey
+ case object NUM_PARTITION_VALUES extends LogKey
case object NUM_POINT extends LogKey
case object NUM_PREFIXES extends LogKey
+ case object NUM_RIGHT_PARTITION_VALUES extends LogKey
case object NUM_SEQUENCES extends LogKey
+ case object NUM_VERSIONS_RETAIN extends LogKey
+ case object OBJECT_AGG_SORT_BASED_FALLBACK_THRESHOLD extends LogKey
case object OBJECT_ID extends LogKey
case object OFFSET extends LogKey
case object OFFSETS extends LogKey
case object OFFSET_SEQUENCE_METADATA extends LogKey
case object OLD_BLOCK_MANAGER_ID extends LogKey
case object OLD_VALUE extends LogKey
+ case object OPEN_COST_IN_BYTES extends LogKey
case object OPTIMIZED_PLAN_COLUMNS extends LogKey
case object OPTIMIZER_CLASS_NAME extends LogKey
case object OPTIONS extends LogKey
case object OP_ID extends LogKey
case object OP_TYPE extends LogKey
+ case object OUTPUT extends LogKey
case object OVERHEAD_MEMORY_SIZE extends LogKey
case object PARSE_MODE extends LogKey
+ case object PARTITIONED_FILE extends LogKey
case object PARTITIONED_FILE_READER extends LogKey
- case object PARTITIONS_SIZE extends LogKey
Review Comment:
`PARTITIONS_SIZE` seems useful. Shall we keep it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583655644
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -191,20 +203,23 @@ object LogKeys {
case object HIVE_OPERATION_TYPE extends LogKey
case object HOST extends LogKey
case object HOST_PORT extends LogKey
- case object IDENTIFIER extends LogKey
Review Comment:
Thanks for unifying them!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582479845
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggregateCodegenSupport.scala:
##########
@@ -340,11 +342,11 @@ trait AggregateCodegenSupport
}
Some(splitCodes)
} else {
- val errMsg = "Failed to split aggregate code into small functions because the parameter " +
- "length of at least one split function went over the JVM limit: " +
- CodeGenerator.MAX_JVM_METHOD_PARAMS_LENGTH
+ val errMsg = log"Failed to split aggregate code into small functions because the " +
+ log"parameter length of at least one split function went over the JVM limit: " +
+ log"${MDC(MAX_JVM_METHOD_PARAMS_LENGTH, CodeGenerator.MAX_JVM_METHOD_PARAMS_LENGTH)}"
if (Utils.isTesting) {
- throw SparkException.internalError(errMsg)
+ throw SparkException.internalError(errMsg.message)
} else {
logInfo(errMsg)
Review Comment:
For it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582500836
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -276,31 +299,40 @@ object LogKeys {
case object NUM_FILES_REUSED extends LogKey
case object NUM_FREQUENT_ITEMS extends LogKey
case object NUM_ITERATIONS extends LogKey
+ case object NUM_LEFT_PARTITION_VALUES extends LogKey
+ case object NUM_LOADED_ENTRIES extends LogKey
case object NUM_LOCAL_FREQUENT_PATTERN extends LogKey
case object NUM_PARTITION extends LogKey
+ case object NUM_PARTITION_VALUES extends LogKey
case object NUM_POINT extends LogKey
case object NUM_PREFIXES extends LogKey
+ case object NUM_RIGHT_PARTITION_VALUES extends LogKey
case object NUM_SEQUENCES extends LogKey
+ case object NUM_VERSIONS_RETAIN extends LogKey
+ case object OBJECT_AGG_SORT_BASED_FALLBACK_THRESHOLD extends LogKey
case object OBJECT_ID extends LogKey
case object OFFSET extends LogKey
case object OFFSETS extends LogKey
case object OFFSET_SEQUENCE_METADATA extends LogKey
case object OLD_BLOCK_MANAGER_ID extends LogKey
case object OLD_VALUE extends LogKey
+ case object OPEN_COST_IN_BYTES extends LogKey
case object OPTIMIZED_PLAN_COLUMNS extends LogKey
case object OPTIMIZER_CLASS_NAME extends LogKey
case object OPTIONS extends LogKey
case object OP_ID extends LogKey
case object OP_TYPE extends LogKey
+ case object OUTPUT extends LogKey
case object OVERHEAD_MEMORY_SIZE extends LogKey
case object PARSE_MODE extends LogKey
+ case object PARTITIONED_FILE extends LogKey
case object PARTITIONED_FILE_READER extends LogKey
- case object PARTITIONS_SIZE extends LogKey
Review Comment:
Unified as` LogKeys.COUNT`, remove `LogKeys.PARTITIONS_SIZE`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582501097
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -111,7 +117,7 @@ object LogKeys {
case object DATA_FILE_NUM extends LogKey
case object DATA_SOURCE extends LogKey
case object DATA_SOURCES extends LogKey
- case object DATA_SOURCE_PROVIDER extends LogKey
Review Comment:
Unified as` LogKeys.DATA_SOURCE`, remove `LogKeys.DATA_SOURCE_PROVIDER`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583674452
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala:
##########
@@ -494,7 +495,7 @@ object DataSourceStrategy
val partitionSet = AttributeSet(partitionColumns)
val predicates = ExpressionSet(normalizedFilters
.flatMap(extractPredicatesWithinOutputSet(_, partitionSet)))
- logInfo(s"Pruning directories with: ${predicates.mkString(",")}")
+ logInfo(log"Pruning directories with: ${MDC(PREDICATES, predicates.mkString(","))}")
Review Comment:
PREDICATES looks fine
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583665029
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -717,14 +716,15 @@ case class RepairTableCommand(
evalPool.shutdown()
}
val total = partitionSpecsAndLocs.length
- logInfo(s"Found $total partitions in $root")
+ logInfo(log"Found ${MDC(LogKeys.TOTAL, total)} partitions in ${MDC(LogKeys.PATH, root)}")
Review Comment:
NUM_PARTITIONS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584011620
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -717,14 +716,15 @@ case class RepairTableCommand(
evalPool.shutdown()
}
val total = partitionSpecsAndLocs.length
- logInfo(s"Found $total partitions in $root")
+ logInfo(log"Found ${MDC(LogKeys.TOTAL, total)} partitions in ${MDC(LogKeys.PATH, root)}")
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583684938
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:
##########
@@ -164,8 +164,10 @@ private[sql] object JDBCRelation extends Logging {
i = i + 1
}
val partitions = ans.toArray
- logInfo(s"Number of partitions: $numPartitions, WHERE clauses of these partitions: " +
- partitions.map(_.asInstanceOf[JDBCPartition].whereClause).mkString(", "))
+ logInfo(log"Number of partitions: ${MDC(COUNT, numPartitions)}, WHERE clauses of " +
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584014307
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:
##########
@@ -164,8 +164,10 @@ private[sql] object JDBCRelation extends Logging {
i = i + 1
}
val partitions = ans.toArray
- logInfo(s"Number of partitions: $numPartitions, WHERE clauses of these partitions: " +
- partitions.map(_.asInstanceOf[JDBCPartition].whereClause).mkString(", "))
+ logInfo(log"Number of partitions: ${MDC(COUNT, numPartitions)}, WHERE clauses of " +
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583665433
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -717,14 +716,15 @@ case class RepairTableCommand(
evalPool.shutdown()
}
val total = partitionSpecsAndLocs.length
- logInfo(s"Found $total partitions in $root")
+ logInfo(log"Found ${MDC(LogKeys.TOTAL, total)} partitions in ${MDC(LogKeys.PATH, root)}")
val partitionStats = if (spark.sessionState.conf.gatherFastStats) {
gatherPartitionStats(spark, partitionSpecsAndLocs, fs, pathFilter, threshold)
} else {
Map.empty[Path, PartitionStatistics]
}
- logInfo(s"Finished to gather the fast stats for all $total partitions.")
+ logInfo(log"Finished to gather the fast stats for all ${MDC(LogKeys.TOTAL, total)} " +
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584009494
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala:
##########
@@ -39,7 +39,7 @@ class FilePartitionReader[T](
if (currentReader == null) {
if (files.hasNext) {
val file = files.next()
- logInfo(s"Reading file $file")
+ logInfo(log"Reading file ${MDC(PARTITIONED_FILE, file)}")
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582500556
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -349,11 +387,11 @@ object LogKeys {
case object RETRY_COUNT extends LogKey
case object RETRY_INTERVAL extends LogKey
case object RIGHT_EXPR extends LogKey
+ case object RIGHT_LOGICAL_PLAN_STATS_SIZE_IN_BYTES extends LogKey
case object RMSE extends LogKey
case object ROCKS_DB_LOG_LEVEL extends LogKey
case object ROCKS_DB_LOG_MESSAGE extends LogKey
case object RPC_ENDPOINT_REF extends LogKey
- case object RULE_BATCH_NAME extends LogKey
Review Comment:
Unified as `LogKeys.BATCH_NAME`, remove `LogKeys.RULE_BATCH_NAME`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582501170
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -124,8 +130,8 @@ object LogKeys {
case object DIFF_DELTA extends LogKey
case object DIVISIBLE_CLUSTER_INDICES_SIZE extends LogKey
case object DRIVER_ID extends LogKey
- case object DROPPED_PARTITIONS extends LogKey
Review Comment:
Rename `DROPPED_PARTITIONS` to `NUM_DROPPED_PARTITIONS`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582478002
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -468,7 +467,7 @@ abstract class Optimizer(catalogManager: CatalogManager)
} else if (filteredRules.nonEmpty) {
Some(Batch(batch.name, batch.strategy, filteredRules: _*))
} else {
- logInfo(log"Optimization batch '${MDC(RULE_BATCH_NAME, batch.name)}' " +
+ logInfo(log"Optimization batch '${MDC(LogKeys.RULE_BATCH_NAME, batch.name)}' " +
Review Comment:
Unified as `LogKeys.BATCH_NAME`, remove `LogKeys.RULE_BATCH_NAME`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584012799
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FilePartition.scala:
##########
@@ -99,7 +99,7 @@ object FilePartition extends Logging {
val desiredSplitBytes =
(totalSizeInBytes / BigDecimal(maxPartNum.get)).setScale(0, RoundingMode.UP).longValue
val desiredPartitions = getFilePartitions(partitionedFiles, desiredSplitBytes, openCostBytes)
- logWarning(log"The number of partitions is ${MDC(PARTITIONS_SIZE, partitions.size)}, " +
+ logWarning(log"The number of partitions is ${MDC(COUNT, partitions.size)}, " +
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582496007
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/r/ArrowRRunner.scala:
##########
@@ -161,17 +166,14 @@ class ArrowRRunner(
val input = dataStream.readDouble
val compute = dataStream.readDouble
val output = dataStream.readDouble
- logInfo(
- ("Times: boot = %.3f s, init = %.3f s, broadcast = %.3f s, " +
- "read-input = %.3f s, compute = %.3f s, write-output = %.3f s, " +
- "total = %.3f s").format(
- boot,
- init,
- broadcast,
- input,
- compute,
- output,
- boot + init + broadcast + input + compute + output))
+ logInfo(log"Times: boot = ${MDC(LogKeys.BOOT, format(boot))} s, " +
Review Comment:
I'm not sure whether to prefix the following keys as `R_`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582501170
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -124,8 +130,8 @@ object LogKeys {
case object DIFF_DELTA extends LogKey
case object DIVISIBLE_CLUSTER_INDICES_SIZE extends LogKey
case object DRIVER_ID extends LogKey
- case object DROPPED_PARTITIONS extends LogKey
Review Comment:
Rename `DROPPED_PARTITIONS` to `NUM_DROPPED_PARTITIONS`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583679160
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala:
##########
@@ -137,9 +138,8 @@ object FileSourceStrategy extends Strategy with PredicateHelper with Logging {
val numBucketsSelected = matchedBuckets.cardinality()
- logInfo {
- s"Pruned ${numBuckets - numBucketsSelected} out of $numBuckets buckets."
- }
+ logInfo(log"Pruned ${MDC(COUNT, numBuckets - numBucketsSelected)} " +
Review Comment:
NUM_PRUNED
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on PR #46264:
URL: https://github.com/apache/spark/pull/46264#issuecomment-2084084535
> LGTM except for a few minor comments on the names.
All done. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582473304
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:
##########
@@ -233,7 +233,7 @@ class FileScanRDD(
if (files.hasNext) {
currentFile = files.next()
updateMetadataRow()
- logInfo(s"Reading File $currentFile")
+ logInfo(log"Reading File ${MDC(PARTITIONED_FILE, currentFile)}")
Review Comment:
The class of `currentFile` is `PartitionedFile`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "gengliangwang (via GitHub)" <gi...@apache.org>.
gengliangwang commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1583695484
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -421,7 +424,8 @@ case class EnsureRequirements(
.mergePartitions(leftSpec.partitioning, rightSpec.partitioning, partitionExprs)
.map(v => (v, 1))
- logInfo(s"After merging, there are ${mergedPartValues.size} partitions")
+ logInfo(
+ log"After merging, there are ${MDC(LogKeys.COUNT, mergedPartValues.size)} partitions")
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582501464
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -191,20 +203,23 @@ object LogKeys {
case object HIVE_OPERATION_TYPE extends LogKey
case object HOST extends LogKey
case object HOST_PORT extends LogKey
- case object IDENTIFIER extends LogKey
Review Comment:
Currently, only `two places` use this `key`, and they all mean `the name of the table`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on PR #46264:
URL: https://github.com/apache/spark/pull/46264#issuecomment-2081820429
cc @gengliangwang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1582500958
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -191,20 +203,23 @@ object LogKeys {
case object HIVE_OPERATION_TYPE extends LogKey
case object HOST extends LogKey
case object HOST_PORT extends LogKey
- case object IDENTIFIER extends LogKey
Review Comment:
Unified as` LogKeys.TABLE_NAME`, remove `LogKeys.IDENTIFIER`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584010936
##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -276,31 +299,40 @@ object LogKeys {
case object NUM_FILES_REUSED extends LogKey
case object NUM_FREQUENT_ITEMS extends LogKey
case object NUM_ITERATIONS extends LogKey
+ case object NUM_LEFT_PARTITION_VALUES extends LogKey
+ case object NUM_LOADED_ENTRIES extends LogKey
case object NUM_LOCAL_FREQUENT_PATTERN extends LogKey
case object NUM_PARTITION extends LogKey
+ case object NUM_PARTITION_VALUES extends LogKey
case object NUM_POINT extends LogKey
case object NUM_PREFIXES extends LogKey
+ case object NUM_RIGHT_PARTITION_VALUES extends LogKey
case object NUM_SEQUENCES extends LogKey
+ case object NUM_VERSIONS_RETAIN extends LogKey
+ case object OBJECT_AGG_SORT_BASED_FALLBACK_THRESHOLD extends LogKey
case object OBJECT_ID extends LogKey
case object OFFSET extends LogKey
case object OFFSETS extends LogKey
case object OFFSET_SEQUENCE_METADATA extends LogKey
case object OLD_BLOCK_MANAGER_ID extends LogKey
case object OLD_VALUE extends LogKey
+ case object OPEN_COST_IN_BYTES extends LogKey
case object OPTIMIZED_PLAN_COLUMNS extends LogKey
case object OPTIMIZER_CLASS_NAME extends LogKey
case object OPTIONS extends LogKey
case object OP_ID extends LogKey
case object OP_TYPE extends LogKey
+ case object OUTPUT extends LogKey
case object OVERHEAD_MEMORY_SIZE extends LogKey
case object PARSE_MODE extends LogKey
+ case object PARTITIONED_FILE extends LogKey
case object PARTITIONED_FILE_READER extends LogKey
- case object PARTITIONS_SIZE extends LogKey
Review Comment:
`PARTITIONS_SIZE` -> `NUM_PARTITIONS`
It has been changed to `NUM_PARTITIONS` as suggested below
At the same time, I unified `LogKeys.NUM_PARTITION` to `LogKeys.NUM_PARTITIONS`, and remove `LogKeys.NUM_PARTITION`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-47585][SQL] SQL core: Migrate logInfo with variables to structured logging framework [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46264:
URL: https://github.com/apache/spark/pull/46264#discussion_r1584014574
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -421,7 +424,8 @@ case class EnsureRequirements(
.mergePartitions(leftSpec.partitioning, rightSpec.partitioning, partitionExprs)
.map(v => (v, 1))
- logInfo(s"After merging, there are ${mergedPartValues.size} partitions")
+ logInfo(
+ log"After merging, there are ${MDC(LogKeys.COUNT, mergedPartValues.size)} partitions")
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org