Github user cloud-fan commented on a diff in the pull request:
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -1827,7 +1827,7 @@ class Dataset[T] private[sql](
         val resolver = sparkSession.sessionState.analyzer.resolver
         val allColumns = queryExecution.analyzed.output
         val remainingCols = allColumns.filter { attribute =>
    -      colNames.forall(n => !resolver(, n))
    +      colNames.forall(n => !(resolver(, n) || 
resolver(attribute.qualifiedName, n)))
    --- End diff --
    This is fragile, what if we wanna drop a qualified column with special 
characters like  "a.\`b c\`"? Users may wanna do ``df.drop("a.`b c`")`` instead 
of ``df.drop("a.b c")``, and what if we just wanna drop a column named `a.b c`?
    The current semantic of `drop` is, if the parameter is string, we treat it 
as column name literal, without any parsing, which is different from `select`. 
If users do wanna use a qualified column name to refer to a specific column, 
they should use the `drop` with `Column` parameter.
    I think the same semantic should apply to `dropDuplicates`, i.e. we should 
add a new version that takes `Seq[Column]` as parameter.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to