You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ludlows (via GitHub)" <gi...@apache.org> on 2023/06/03 15:21:51 UTC

[GitHub] [iceberg] ludlows opened a new pull request, #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files

ludlows opened a new pull request, #7760:
URL: https://github.com/apache/iceberg/pull/7760

   backport the fix in the PR (https://github.com/apache/iceberg/pull/6760) to Spark 3.1 and 3.2 versions.
   


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] ajantha-bhat commented on pull request #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files

Posted by "ajantha-bhat (via GitHub)" <gi...@apache.org>.
ajantha-bhat commented on PR #7760:
URL: https://github.com/apache/iceberg/pull/7760#issuecomment-1739543853

   Please rebase.
   
   spark-3.1 module is removed from master code.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] ludlows commented on a diff in pull request #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files

Posted by "ludlows (via GitHub)" <gi...@apache.org>.
ludlows commented on code in PR #7760:
URL: https://github.com/apache/iceberg/pull/7760#discussion_r1228831213


##########
spark/v3.1/spark/src/main/scala/org/apache/spark/sql/execution/datasources/SparkExpressionConverter.scala:
##########
@@ -36,15 +40,16 @@ object SparkExpressionConverter {
 
   @throws[AnalysisException]
   def collectResolvedSparkExpression(session: SparkSession, tableName: String, where: String): Expression = {
-    var expression: Expression = null
-    // Add a dummy prefix linking to the table to collect the resolved spark expression from optimized plan.
-    val prefix = String.format("SELECT 42 from %s where ", tableName)
-    val logicalPlan = session.sessionState.sqlParser.parsePlan(prefix + where)
-    val optimizedLogicalPlan = session.sessionState.executePlan(logicalPlan).optimizedPlan
+    val tableAttrs = session.table(tableName).queryExecution.analyzed.output
+    val unresolvedExpression = session.sessionState.sqlParser.parseExpression(where)
+    val filter = Filter(unresolvedExpression, DummyRelation(tableAttrs))

Review Comment:
   it seems that "select 42 from table where" is used only to form a complete sql sentence together with the where condtion. now we can evaluate the where condtion directly without this "select" sql sentence. 



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] szehon-ho commented on a diff in pull request #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files

Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #7760:
URL: https://github.com/apache/iceberg/pull/7760#discussion_r1228451732


##########
spark/v3.1/spark/src/main/scala/org/apache/spark/sql/execution/datasources/SparkExpressionConverter.scala:
##########
@@ -36,15 +40,16 @@ object SparkExpressionConverter {
 
   @throws[AnalysisException]
   def collectResolvedSparkExpression(session: SparkSession, tableName: String, where: String): Expression = {
-    var expression: Expression = null
-    // Add a dummy prefix linking to the table to collect the resolved spark expression from optimized plan.
-    val prefix = String.format("SELECT 42 from %s where ", tableName)
-    val logicalPlan = session.sessionState.sqlParser.parsePlan(prefix + where)
-    val optimizedLogicalPlan = session.sessionState.executePlan(logicalPlan).optimizedPlan
+    val tableAttrs = session.table(tableName).queryExecution.analyzed.output
+    val unresolvedExpression = session.sessionState.sqlParser.parseExpression(where)
+    val filter = Filter(unresolvedExpression, DummyRelation(tableAttrs))

Review Comment:
   I'm not too familiar, but the removal of select 42 is part of #6524, and I'm not confident if we can put that change here 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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] ludlows closed pull request #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files

Posted by "ludlows (via GitHub)" <gi...@apache.org>.
ludlows closed pull request #7760: Spark 3.1 3.2: Fix always true/false condition in rewrite_data_files
URL: https://github.com/apache/iceberg/pull/7760


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org