You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "hsiang-c (via GitHub)" <gi...@apache.org> on 2025/04/21 18:22:10 UTC
[PR] feat: More warning info for users [datafusion-comet]
hsiang-c opened a new pull request, #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #. https://github.com/apache/datafusion-comet/issues/1612
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
Let users know the unsupported field(s) in the schema and the configuration that lead to the warning message.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
- When we detect unsupported schemas / partitioning schemas, report the first unsupported field in the schemas as part of the `fallbackReasons`.
- Additionally, shows that `spark.comet.scan.allowIncompatible` is set to false on native scan implementations.
## How are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
### Config 1
```scala
.config("spark.comet.scan.impl", "native_comet")
.config("spark.comet.scan.allowIncompatible", "false")
```
```shell
25/04/18 15:18:23 WARN CometSparkSessionExtensions$CometExecRule: Comet cannot execute some parts of this plan natively (set spark.comet.explainFallback.enabled=false to disable this logging):
CollectLimit [COMET: CollectLimit is not supported]
+- Project [COMET: Project is not native because the following children are not native (Scan parquet )]
+- Scan parquet [COMET: Unsupported field StructField(weight_kg,ArrayType(ShortType,true),true) in schema StructType(StructField(product_id,StringType,true),StructField(product_name,StringType,true),StructField(weight_kg,ArrayType(ShortType,true),true)) for native_comet, Scan parquet is not supported]
```
### Config 2
```scala
.config("spark.comet.scan.impl", "native_datafusion")
.config("spark.comet.scan.allowIncompatible", "false")
```
```shell
25/04/18 15:19:44 WARN CometSparkSessionExtensions$CometExecRule: Comet cannot execute some parts of this plan natively (set spark.comet.explainFallback.enabled=false to disable this logging):
CollectLimit [COMET: CollectLimit is not supported]
+- Project [COMET: Project is not native because the following children are not native (Scan parquet )]
+- Scan parquet [COMET: Unsupported field StructField(weight_kg,ArrayType(ShortType,true),true) in schema StructType(StructField(product_id,StringType,true),StructField(product_name,StringType,true),StructField(weight_kg,ArrayType(ShortType,true),true)) for native_datafusion, and spark.comet.scan.allowIncompatible is false, Scan parquet is not supported]
```
### Config 3
```scala
.config("spark.comet.scan.impl", "native_iceberg_compat")
.config("spark.comet.scan.allowIncompatible", "false")
```
```shell
25/04/18 15:20:37 WARN CometSparkSessionExtensions$CometExecRule: Comet cannot execute some parts of this plan natively (set spark.comet.explainFallback.enabled=false to disable this logging):
CollectLimit [COMET: CollectLimit is not supported]
+- Project [COMET: Project is not native because the following children are not native (Scan parquet )]
+- Scan parquet [COMET: Unsupported field StructField(weight_kg,ArrayType(ShortType,true),true) in schema StructType(StructField(product_id,StringType,true),StructField(product_name,StringType,true),StructField(weight_kg,ArrayType(ShortType,true),true)) for native_iceberg_compat, and spark.comet.scan.allowIncompatible is false, Scan parquet is not supported]
```
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2059163344
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
Review Comment:
Removed, this is no longer valid.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054613906
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
This PR introduces a two-step process:
1) call `isTypeSupported`
2) call `findUnsupportedField` if `isTypeSupported` returns `false`
I wonder if we should consider a different approach so that we do not have to duplicate the logic.
One idea would be to pass an accumulator into `isTypeSupported` that can collect fallback reasons. For example:
```scala
def isTypeSupported(dt: DataType, fallbackReasons: mutable.ListBuffer[String]): Boolean
```
Another approach would be to rename `isTypeSupported` to `validateTypeSupported` and have it throw an exception when it encounters the first unsupported type.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067175853
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
We should have a fallback reason here as well, perhaps:
```suggestion
case other =>
fallbackReasons += s"Unsupported type: $other"
false
```
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "parthchandra (via GitHub)" <gi...@apache.org>.
parthchandra commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2056942543
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
I like the idea of collecting the fallback reasons as part of the `isTypeSupported` call and yes, renaming it to `validateTypeSupported` would be a good idea in that case.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054367997
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -37,8 +39,7 @@ trait DataTypeSupport {
private def isGloballySupported(dt: DataType): Boolean = dt match {
case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
+ if usingParquetExecWithIncompatTypes(CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
Review Comment:
This config could change during the Spark session lifetime (we often change it during tests, for example)
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054294073
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
Review Comment:
do we need this asserts? it can lead to runtime exceptions
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054660077
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
@comphead @parthchandra @mbutrovich any thoughts on the approach we should take here?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067187303
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -1253,9 +1254,8 @@ object CometSparkSessionExtensions extends Logging {
org.apache.spark.SPARK_VERSION >= "4.0"
}
- def usingDataFusionParquetExec(conf: SQLConf): Boolean =
- Seq(CometConf.SCAN_NATIVE_ICEBERG_COMPAT, CometConf.SCAN_NATIVE_DATAFUSION).contains(
- CometConf.COMET_NATIVE_SCAN_IMPL.get(conf))
+ def usingDataFusionParquetExec(scanImpl: String): Boolean =
Review Comment:
This refactor has made the call sites more complex/verbose. Before, we had:
```scala
usingDataFusionParquetExec(conf)
```
and now we have
```scala
usingDataFusionParquetExec(CometConf.COMET_NATIVE_SCAN_IMPL.get(conf))
```
I don't see any calls where we pass in a string that didn't come from the conf. @hsiang-c is this refactor really needed?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2066356877
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -56,23 +65,46 @@ trait DataTypeSupport {
* @return
* true if all fields in the struct are supported
*/
- def isSchemaSupported(struct: StructType): Boolean = {
- struct.fields.map(_.dataType).forall(isTypeSupported)
+ def isSchemaSupported(struct: StructType, fallbackReasons: ListBuffer[String]): Boolean = {
+ struct.fields.forall(f => validateTypeSupported(f.dataType, f.name, fallbackReasons))
}
- def isTypeSupported(dt: DataType): Boolean = {
- if (isGloballySupported(dt) || isAdditionallySupported(dt)) {
+ def validateTypeSupported(
Review Comment:
Because this method still returns a boolean, I think that the name should still be `isTypeSupported`.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067930692
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
I think I might know why. When `fallbackReasons` is empty, we do `CometScanExec (V1) / CometBatchScanExec (V2)`. Otherwise, we do `scanExec`.
Perhaps we could leverage the flags instead of `fallbackReasons` being empty to make the decision? For example, in `transformV1Scan`:
```java
// if (fallbackReasons.isEmpty) {
if (schemaSupported && partitionSchemaSupported) {
CometScanExec(scanExec, session)
} else {
withInfo(scanExec, fallbackReasons.mkString(", "))
}
```
@andygrove Please let me know if it makes sense to you.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067930692
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
I think I might know why. When `fallbackReasons` is empty, we do `CometScanExec (V1) / CometBatchScanExec (V2)`. Otherwise, we do `scanExec`.
However, this PR changes the behavior. `fallbackReasons` can be non empty while all conditions met for CometScanExec / CometBatchScanExec.
Perhaps we could leverage the flags instead of `fallbackReasons` being empty to make the decision? For example, in `transformV1Scan`:
```java
// if (fallbackReasons.isEmpty) {
if (schemaSupported && partitionSchemaSupported) {
CometScanExec(scanExec, session)
} else {
withInfo(scanExec, fallbackReasons.mkString(", "))
}
```
@andygrove Please let me know if it makes sense to you.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054295647
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
perhaps it would be easier to specify data type as well?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054695921
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
@andygrove Good feedback, let me think about 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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067903455
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
@andygrove I haven't figured out why, but adding it will produce a different `SparkPlan`
Without the reason, I get
```
*(1) CometColumnarToRow
+- CometProject [firstName#10, lastName#11, age#12], [personal_info#8.firstName AS firstName#10, personal_info#8.lastName AS lastName#11, personal_info#8.age AS age#12]
+- CometNativeScan parquet [personal_info#8] Batched: true, DataFilters: [], Format: CometParquet, Location: InMemoryFileIndex(1 paths)[file:/private/var/folders/d2/b93h6k7174ddqxltrxgb51040000gn/T/spark-8a..., PartitionFilters: [], PushedFilters: [], ReadSchema: struct<personal_info:struct<firstName:string,lastName:string,age:int>>
```
With the reason, I don't get a Comet plan hence unit tests fail:
```shell
*(1) Project [personal_info#8.firstName AS firstName#10, personal_info#8.lastName AS lastName#11, personal_info#8.age AS age#12]
+- *(1) ColumnarToRow
+- FileScan parquet [personal_info#8] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex(1 paths)[file:/private/var/folders/d2/b93h6k7174ddqxltrxgb51040000gn/T/spark-b1..., PartitionFilters: [], PushedFilters: [], ReadSchema: struct<personal_info:struct<firstName:string,lastName:string,age:int>>
```
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054307233
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -37,8 +39,7 @@ trait DataTypeSupport {
private def isGloballySupported(dt: DataType): Boolean = dt match {
case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
+ if usingParquetExecWithIncompatTypes(CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
Review Comment:
can we create a global lazy val to reduce number of `CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)` ?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054613906
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
This PR introduces a two-step process:
1) call `isTypeSupported`
2) call `findUnsupportedField` if `isTypeSupported` returns `false`
I wonder if we should consider a different approach so that we do not have to duplicate the logic.
One idea would be to pass an accumulator into `isTypeSupported` that can collect fallback reasons. For example:
```scala
def isTypeSupported(dt: DataType, fallbackReasons: mutable.List[String])
```
Another approach would be to rename `isTypeSupported` to `validateTypeSupported` and have it throw an exception when it encounters the first unsupported type.
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
This PR introduces a two-step process:
1) call `isTypeSupported`
2) call `findUnsupportedField` if `isTypeSupported` returns `false`
I wonder if we should consider a different approach so that we do not have to duplicate the logic.
One idea would be to pass an accumulator into `isTypeSupported` that can collect fallback reasons. For example:
```scala
def isTypeSupported(dt: DataType, fallbackReasons: mutable.List[String]): Boolean
```
Another approach would be to rename `isTypeSupported` to `validateTypeSupported` and have it throw an exception when it encounters the first unsupported type.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054555242
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -37,8 +39,7 @@ trait DataTypeSupport {
private def isGloballySupported(dt: DataType): Boolean = dt match {
case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
+ if usingParquetExecWithIncompatTypes(CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
Review Comment:
fair enough, it can be a function.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054613906
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
This PR introduces a two-step process:
1) call `isTypeSupported`
2) call `findUnsupportedField` if `isTypeSupported` returns `false`
I wonder if we should consider a different approach so that do not have to duplicate the logic.
One idea would be to pass an accumulator into `isTypeSupported` that can collect fallback reasons. For example:
```scala
def isTypeSupported(dt: DataType, fallbackReasons: mutable.List[String])
```
Another approach would be to rename `isTypeSupported` to `validateTypeSupported` and have it throw an exception when it encounters the first unsupported type.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#issuecomment-2822167010
## [Codecov](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `82.60870%` with `4 lines` in your changes missing coverage. Please review.
> Project coverage is 57.48%. Comparing base [(`f09f8af`)](https://app.codecov.io/gh/apache/datafusion-comet/commit/f09f8af64c6599255e116a376f4f008f2fd63b43?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`fbc1cf1`)](https://app.codecov.io/gh/apache/datafusion-comet/commit/fbc1cf1c3e8e6fbe511ad36bbdbc5c3f2a225db1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 156 commits behind head on main.
| [Files with missing lines](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...org/apache/comet/CometSparkSessionExtensions.scala](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?src=pr&el=tree&filepath=spark%2Fsrc%2Fmain%2Fscala%2Forg%2Fapache%2Fcomet%2FCometSparkSessionExtensions.scala&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3Bhcmsvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9jb21ldC9Db21ldFNwYXJrU2Vzc2lvbkV4dGVuc2lvbnMuc2NhbGE=) | 82.35% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../main/scala/org/apache/comet/DataTypeSupport.scala](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?src=pr&el=tree&filepath=spark%2Fsrc%2Fmain%2Fscala%2Forg%2Fapache%2Fcomet%2FDataTypeSupport.scala&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3Bhcmsvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9jb21ldC9EYXRhVHlwZVN1cHBvcnQuc2NhbGE=) | 80.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #1667 +/- ##
============================================
+ Coverage 56.12% 57.48% +1.35%
- Complexity 976 1021 +45
============================================
Files 119 125 +6
Lines 11743 12525 +782
Branches 2251 2357 +106
============================================
+ Hits 6591 7200 +609
- Misses 4012 4136 +124
- Partials 1140 1189 +49
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/datafusion-comet/pull/1667?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#issuecomment-2831140241
@parthchandra Yes, I think I changed the behaviors of both `ParquetDatetimeRebaseV2Suite` and `ParquetReadV2Suite`. Though in the code they are configured with `native_comet` impl.
```scala
CometConf.COMET_NATIVE_SCAN_IMPL.key -> CometConf.SCAN_NATIVE_COMET
```
But the failed tests are against `native_datafusion` and `native_iceberg_compat` b/c the build environments are set like
```
env:
COMET_PARQUET_SCAN_IMPL: native_datafusion
```
```
env:
COMET_PARQUET_SCAN_IMPL: native_iceberg_compat
```
Will fix it shortly.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2052826270
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -76,3 +81,10 @@ trait DataTypeSupport {
}
}
}
+
+object DataTypeSupport {
+ def usingParquetExecWithIncompatTypes(scanImpl: String): Boolean = {
+ CometSparkSessionExtensions.usingDataFusionParquetExec(scanImpl) &&
Review Comment:
Extract this condition to a method b/c I found it in multiple classes.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054576057
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
@comphead Thanks for the feedback.
Perhaps the field itself is sufficient? It has field name and filed type. Here is an example: `StructField(weight_kg,ArrayType(ShortType,true),true)`
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2054587262
##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -161,10 +161,28 @@ class CometSparkSessionExtensions
}
if (!schemaSupported) {
- fallbackReasons += s"Unsupported schema ${scanExec.requiredSchema} for $scanImpl"
+ val field: Option[StructField] =
+ CometNativeScanExec
+ .findUnsupportedField(scanExec.requiredSchema)
+ .orElse(CometScanExec.findUnsupportedField(scanExec.requiredSchema))
+ assert(field.nonEmpty)
+ fallbackReasons +=
+ s"Unsupported field ${field.get} in schema ${scanExec.requiredSchema} for $scanImpl"
Review Comment:
Field sounds good to me, but now I'm wondering how it may look like if unsupported datatype like BYTE is deep nested field?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2068991765
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
I will help with this today
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "hsiang-c (via GitHub)" <gi...@apache.org>.
hsiang-c commented on code in PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#discussion_r2067930692
##########
spark/src/main/scala/org/apache/comet/DataTypeSupport.scala:
##########
@@ -33,20 +37,25 @@ trait DataTypeSupport {
* @return
* true if the datatype is supported
*/
- def isAdditionallySupported(dt: DataType): Boolean = false
+ def isAdditionallySupported(
+ dt: DataType,
+ name: String,
+ fallbackReasons: ListBuffer[String]): Boolean = false
- private def isGloballySupported(dt: DataType): Boolean = dt match {
- case ByteType | ShortType
- if CometSparkSessionExtensions.usingDataFusionParquetExec(SQLConf.get) &&
- !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get() =>
- false
- case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
- BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
- true
- case t: DataType if t.typeName == "timestamp_ntz" =>
- true
- case _ => false
- }
+ private def isGloballySupported(dt: DataType, fallbackReasons: ListBuffer[String]): Boolean =
+ dt match {
+ case ByteType | ShortType
+ if usingParquetExecWithIncompatTypes(
+ CometConf.COMET_NATIVE_SCAN_IMPL.get(SQLConf.get)) =>
+ fallbackReasons += s"${CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.key} is false"
+ false
+ case BooleanType | ByteType | ShortType | IntegerType | LongType | FloatType | DoubleType |
+ BinaryType | StringType | _: DecimalType | DateType | TimestampType =>
+ true
+ case t: DataType if t.typeName == "timestamp_ntz" =>
+ true
+ case _ => false
Review Comment:
I think I might know why. When `fallbackReasons` is empty, we do `CometScanExec (V1) / CometBatchScanExec (V2)`. Otherwise, we do `scanExec`.
So perhaps when we have fallback, we should skip `checkCometOperators` in `CometTestBase.java`?
@andygrove Please let me know if it makes sense to you.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat: More warning info for users [datafusion-comet]
Posted by "parthchandra (via GitHub)" <gi...@apache.org>.
parthchandra commented on PR #1667:
URL: https://github.com/apache/datafusion-comet/pull/1667#issuecomment-2830836202
Re-running the failed ci (the failures do not seem to be related)
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org