gengliangwang commented on code in PR #41549:
URL: https://github.com/apache/spark/pull/41549#discussion_r1227302024
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -1401,12 +1399,29 @@ trait TableSpec {
case class UnresolvedTableSpec(
properties: Map[String, String],
provider: Option[String],
+ optionExpression: OptionList,
location: Option[String],
comment: Option[String],
serde: Option[SerdeInfo],
- external: Boolean) extends TableSpec {
+ external: Boolean) extends UnaryExpression with Unevaluable with TableSpec
{
+
+ override def dataType: DataType =
+ throw new UnsupportedOperationException("UnresolvedTableSpec doesn't have
a data type")
+
+ override def options: Map[String, String] =
+ throw new UnsupportedOperationException("Can't access options of
UnresolvedTableSpec")
Review Comment:
> do we need the options to exist in the base class TableSpec
I would say yes. Table options should be part of the `TableSpec`
> I am just wondering because this may be safer to prevent accidental calls
to this base class options list in the future when we think that the TableSpec
is always going to be resolved.
On the other hand, before the refactor, it is tricky to access the options.
We can put a code comment in the method `options`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]