You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "huaxingao (via GitHub)" <gi...@apache.org> on 2024/07/24 00:52:18 UTC
[PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
huaxingao opened a new pull request, #10766:
URL: https://github.com/apache/iceberg/pull/10766
In Iceberg's `spark-extensions`, if we encounter any invalid SQL statements, we throw Spark's `AnalysisException`. However, it would be better to have Iceberg's own `IcebergAnalysisException` to differentiate it from the `AnalysisException` issued by Spark itself.
Another reason to have Iceberg's own `IcebergAnalysisException` is due to Spark's new error handling scheme. Since Spark 3.2, Spark has introduced an error class system. For the `AnalysisExceptions` that are issued in Iceberg's `spark-extensions`, we don't really have a corresponding Spark error class. Therefore, it seems better to have Iceberg's own `IcebergAnalysisException` to differentiate it from the `AnalysisException` issued by Spark itself.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#discussion_r1692245109
##########
spark/v3.5/spark/src/main/java/org/apache/spark/sql/catalyst/analysis/IcebergAnalysisException.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.spark.sql.catalyst.analysis;
+
+import org.apache.spark.QueryContext;
+import org.apache.spark.sql.AnalysisException;
+import scala.Option;
+import scala.collection.immutable.Map$;
+
+public class IcebergAnalysisException extends AnalysisException {
+ public IcebergAnalysisException(String message) {
+ super(
+ message,
+ Option.empty(),
Review Comment:
OK synced with @huaxingao looks like its not the right method.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2253547485
> This makes sense, let me take a deeper look tomorrow. I think in a subsequent pr we can make a pass in the error messages to try to follow: https://spark.apache.org/error-message-guidelines.html ?
We haven't written this down (I think) but we generally have similar rules that we should probably publish.
X (Who) did (what). This is broken because (y). (Possible resolution 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: 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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#discussion_r1692091564
##########
spark/v3.5/spark/src/main/java/org/apache/spark/sql/catalyst/analysis/IcebergAnalysisException.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.spark.sql.catalyst.analysis;
+
+import org.apache.spark.QueryContext;
+import org.apache.spark.sql.AnalysisException;
+import scala.Option;
+import scala.collection.immutable.Map$;
+
+public class IcebergAnalysisException extends AnalysisException {
+ public IcebergAnalysisException(String message) {
+ super(
+ message,
+ Option.empty(),
Review Comment:
Hm i tried this and it seemed to compile, i wonder if we have different settings?
```
public class IcebergAnalysisException extends AnalysisException {
public IcebergAnalysisException(String message) {
super(message, Map$.MODULE$.<String, String>empty());
}
}
```
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2466519741
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2251536703
I think im ok with it. I slightly prefer to not have this until 4.0, as it doesnt seem that necessary , but I think it will not hurt. Per https://github.com/apache/spark/commit/3e0808c33f185c13808ce2d547ce9ba0057d31a6 it seems the recommended approach (subclass AnalysisException)
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2247098069
When constructing a new `AnalysisException`, if we can find a corresponding error class in Spark, we should use the correct error class. However, some of the errors are more iceberg specific, for example, `ALTER TABLE has no changes: missing both distribution and ordering clauses`, there isn't a corresponding Spark error class for this, and it's not practical to go to Spark to add an error class for each of the iceberg errors. Spark 4.0 requires `AnalysisException` to have error class, in another word, we don' have a way to construct an `AnalysisException` without specifying an error class , but Spark doesn't require the subclass of `AnalysisException` to have error class, that's why I am adding an `IcebergAnalysisException`, so we can still constructing an `IcebergAnalysisException` without error message only.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on code in PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#discussion_r1690602060
##########
spark/v3.5/spark/src/main/java/org/apache/spark/sql/catalyst/analysis/IcebergAnalysisException.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.spark.sql.catalyst.analysis;
+
+import org.apache.spark.QueryContext;
+import org.apache.spark.sql.AnalysisException;
+import scala.Option;
+import scala.collection.immutable.Map$;
+
+public class IcebergAnalysisException extends AnalysisException {
+ public IcebergAnalysisException(String message) {
+ super(
+ message,
+ Option.empty(),
Review Comment:
We can remove all these non-mandatory arguments
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2249186701
> Curious what's the plan for Spark 4.0 then?
I can't find a formally written down plan for this.
> Just brainstorming out loud the value of IcebergAnalysisException, another option is to just use INTERNAL_ERROR error class, or somehow have a generic Spark plugin error class?
I think `INTERNAL_ERROR` is for any kind of `SparkException`, which is broader than an `AnalysisException`
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2480862614
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2246758141
cc @szehon-ho
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2253550137
@huaxingao Do we have to do this in 3.5 or is it only required for 4.0?
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2253607788
> Do we have to do this in 3.5 or is it only required for 4.0?
@RussellSpitzer Thanks for reviewing the PR! We don't have to do this in 3.5. I was just trying to separate a few small changes that we could implement in 3.5, so we would have fewer changes for 4.0.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2249088638
> Spark 4.0 requires AnalysisException to have error class
Curious what's the plan for Spark 4.0 then?
Just brainstorming out loud the value of IcebergAnalysisException, another option is to just use INTERNAL_ERROR error class, or somehow have a generic Spark plugin error class? @rdblue @aokolnychyi if any thoughts.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on code in PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#discussion_r1690665089
##########
spark/v3.5/spark/src/main/java/org/apache/spark/sql/catalyst/analysis/IcebergAnalysisException.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.spark.sql.catalyst.analysis;
+
+import org.apache.spark.QueryContext;
+import org.apache.spark.sql.AnalysisException;
+import scala.Option;
+import scala.collection.immutable.Map$;
+
+public class IcebergAnalysisException extends AnalysisException {
+ public IcebergAnalysisException(String message) {
+ super(
+ message,
+ Option.empty(),
Review Comment:
Thank you for your comment, but I don’t think I can remove these parameters. If I do, I encounter a compilation error.
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2247135039
This makes sense, let me take a deeper look tomorrow. I think in a subsequent pr we can make a pass in the error messages to try to follow: https://spark.apache.org/error-message-guidelines.html ?
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2246856254
Hi @huaxingao thanks, this mostly makes sense to me, but just wanted to get the motivation. Is it so the user can see the error comes from Iceberg vs other part of Spark? Also, is there an issue if we dont use Spark's error class system (I guess IcebergAnalysisException wont be a part of it)? also cc @RussellSpitzer if any thoughts on this
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2253554397
My only worry here is that RevAPI is missing this as a public api method change because it's in Scala but we are changing the named exception being thrown and thus changing a method signature. At the same time I think this is pretty much private code, so not a big deal.
Any way if we could put this off till 4.0 I would still do that. But no strong feelings 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: 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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #10766: Add `IcebergAnalysisException` in iceberg-spark module
URL: https://github.com/apache/iceberg/pull/10766
--
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
Re: [PR] Add `IcebergAnalysisException` in iceberg-spark module [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #10766:
URL: https://github.com/apache/iceberg/pull/10766#issuecomment-2253612812
> We haven't written this down (I think) but we generally have similar rules that we should probably publish.
I will check to see if we need a doc PR for this
--
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