Condividi tramite


exceptAll

Restituisce un nuovo dataframe contenente righe in questo dataframe ma non in un altro dataframe mantenendo i duplicati.

Sintassi

exceptAll(other: "DataFrame")

Parametri

Parametro Tipo Descrizione
other DataFrame L'altro dataframe da confrontare.

Restituzioni

DataFrame

Note

Equivale a EXCEPT ALL in SQL. Come standard in SQL, questa funzione risolve le colonne in base alla posizione (non per nome).

Examples

df1 = spark.createDataFrame(
        [("a", 1), ("a", 1), ("a", 1), ("a", 2), ("b",  3), ("c", 4)], ["C1", "C2"])
df2 = spark.createDataFrame([("a", 1), ("b", 3)], ["C1", "C2"])
df1.exceptAll(df2).show()
# +---+---+
# | C1| C2|
# +---+---+
# |  a|  1|
# |  a|  1|
# |  a|  2|
# |  c|  4|
# +---+---+