Snowpark Migration Accelerator: Problemcodes für Python¶
SPRKPY1000¶
Meldung: Die Spark-Core-Version des Quellprojekts ist xx.xx:xx.x.x, die von Snowpark unterstützte Spark-Core-Version ist 2.12:3.1.2, so dass es funktionale Unterschiede zwischen den vorhandenen Zuordnungen geben kann.
Kategorie: Warnung.
Beschreibung¶
Dieses Problem tritt auf, wenn die Pyspark-Version Ihres Quellcodes nicht unterstützt wird. Das bedeutet, dass es funktionale Unterschiede zwischen den bestehenden Zuordnungen geben kann.
Zusätzliche Empfehlungen¶
Die pyspark-Version, die von SMA auf Kompatibilität mit Snowpark geprüft wird, reicht von 2.12 bis 3.1.2. Wenn Sie eine Version außerhalb dieses Bereichs verwenden, kann das Tool inkonsistente Ergebnisse liefern. Sie können die Version des Quellcodes, den Sie scannen, ändern.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1001¶
Message**:** This code section has parsing errors
Category**:** Parsing error.
Beschreibung¶
Ein Parsing-Fehler wird vom Snowpark Migration Accelerator (SMA) gemeldet, wenn er den Code in einer Datei nicht richtig lesen oder verstehen kann (er kann die Datei nicht richtig „parsen“). Dieser Problemcode wird angezeigt, wenn eine Datei einen oder mehrere Parsing-Fehler aufweist.
Szenario¶
Eingabe: Die EWI-Meldung wird angezeigt, wenn der Code eine ungültige Syntax hat, zum Beispiel:
Ausgabe: SMA Finden Sie einen Parsing-Fehler und kommentieren Sie den Parsing-Fehler, indem Sie die entsprechende EWI-Meldung hinzufügen:
Zusätzliche Empfehlungen¶
Check that the file contains valid Python code. (You can use the issues.csv file to find all files with this EWI code to determine which file(s) were not processed by the tool due to parsing error(s).) Many parsing errors occur because only part of the code is input into the tool, so it’s bets to ensure that the code will run in the source. If it is valid, report that you encountered a parsing error using the Report an Issue option in the SMA. Include the line of code that was causing a parsing error in the description when you file this issue.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1002¶
Message**:** < element > is not supported,Spark element is not supported.
Category**:** Conversion error.
Beschreibung¶
Dieses Problem tritt auf, wenn das Tool die Verwendung eines Elements erkennt, das in Snowpark nicht unterstützt wird und für das kein eigener Fehlercode existiert. Dies ist der allgemeine Fehlercode, der von SMA für ein nicht unterstütztes Element verwendet wird.
Zusätzliche Empfehlungen¶
Auch wenn die Option oder das Element in der Nachricht nicht unterstützt wird, bedeutet dies nicht, dass keine Lösung gefunden werden kann. Es bedeutet nur, dass das Tool selbst keine Lösung finden kann.
Wenn Sie auf ein nicht unterstütztes Element aus einer pyspark.ml Bibliothek gestoßen sind, sollten Sie eine Alternative in Erwägung ziehen. Es gibt weitere Leitfäden, die sich mit Problemen im Zusammenhang mit ml befassen, wie z. B. dieser von Snowflake.
Prüfen Sie, ob der Quellcode die richtige Syntax hat. (Sie können die Datei issues.csv verwenden, um festzustellen, wo der/die Konvertierungsfehler auftritt/auftreten) Wenn die Syntax korrekt ist, melden Sie einen Konvertierungsfehler für ein bestimmtes Element mit der Option „Problem melden“ auf SMA. Geben Sie die Codezeile, die den Fehler verursacht hat, in der Beschreibung an, wenn Sie dieses Problem melden.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1003¶
Message**:** An error occurred when loading the symbol table.
Category**:** Conversion error.
Beschreibung¶
Dieses Problem tritt auf, wenn ein Fehler bei der Verarbeitung der Symbole in der Symboltabelle auftritt. Die Symboltabelle ist Teil der zugrunde liegenden Architektur von SMA und ermöglicht komplexere Konvertierungen. Dieser Fehler könnte auf eine unerwartete Anweisung im Quellcode zurückzuführen sein.
Zusätzliche Empfehlungen¶
This is unlikely to be an error in the source code itself, but rather is an error in how the tool processes the source code. The best resolution would be to post an issue in the SMA.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1004¶
Message**:** The symbol table could not be loaded.
Category**:** Parsing error.
Beschreibung¶
Dieses Problem tritt auf, wenn ein unerwarteter Fehler bei der Ausführung des Tools auftritt. Da die Symboltabelle nicht geladen werden kann, kann das Tool den Bewertungs- oder Konvertierungsprozess nicht starten.
Zusätzliche Empfehlungen¶
This is unlikely to be an error in the source code itself, but rather is an error in how the tool processes the source code. The best resolution would be to reach out to the SMA support team. You can email us at sma-support@snowflake.com.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1005¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.conf.SparkConf is not required
Category**:** Warning.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf which is not required.
Szenario¶
Eingabe
SparkConf kann ohne Parameter oder mit loadDefaults aufgerufen werden.
Ausgabe
For both cases (with or without parameters) SMA creates a Snowpark Session.builder object:
Zusätzliche Empfehlungen¶
Hier wird ein unnötiger Parameter entfernt und ein Warnkommentar eingefügt. Der Benutzer muss nichts weiter tun.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1006¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.context.SparkContext is not required
Category**:** Warning.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.context.SparkContext, which is not required in Snowflake.
Szenario¶
Eingabe
In diesem Beispiel gibt es zwei Kontexte, eine Verbindung zu einem Spark-Cluster herzustellen
Ausgabe
Da es auf Snowflake keine Cluster gibt, ist der Kontext nicht erforderlich. Beachten Sie, dass die Variablen my_sc1 und my_sc2, die Spark-Eigenschaften enthalten, möglicherweise nicht erforderlich sind oder angepasst werden müssen, um den Code zu korrigieren.
Zusätzliche Empfehlungen¶
Hier wird ein unnötiger Parameter entfernt und ein Warnkommentar eingefügt. Der Benutzer muss nichts unternehmen.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1007¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.sql.context.SQLContext is not required
Category**:** Warning.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.context.SQLContext, which is not required.
Szenario¶
Eingabe
Hier haben wir ein Beispiel mit verschiedenen SparkContext-Überlastungen.
Ausgabe
Der Ausgabecode hat die Zeile für pyspark.SQLContext auskommentiert und ersetzt die Szenarien durch eine Referenz auf eine Konfiguration. Beachten Sie, dass die Variablen my_sc1 und my_sc2, die Spark-Eigenschaften enthalten, möglicherweise nicht benötigt werden oder angepasst werden müssen, um den Code zu korrigieren.
Zusätzliche Empfehlungen¶
Dies ist ein unnötiger Parameter und wird mit einem Warnkommentar im Quellcode entfernt. Der Benutzer muss nichts unternehmen.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1008¶
Meldung: pyspark.sql.context.HiveContext ist nicht erforderlich
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.context.HiveContext, which is not required.
Szenario¶
Eingabe
In diesem Beispiel wird eine Verbindung zu einem Hive-Speicher erstellt.
Ausgabe
In Snowflake there are not Hive stores, so the Hive Context is not required, You can still use parquet files on Snowflake please check this tutorial to learn how.
the sc variable refers to a Snow Park Session Object
Empfohlene Korrektur
For the output code in the example you should add the Snow Park Session Object similar to this code:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1009¶
Message**:** pyspark.sql.dataframe.DataFrame.approxQuantile has a workaround
Category**:** Warning.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrame.approxQuantile which has a workaround.
Szenario¶
Eingabe
It’s important understand that Pyspark uses two different approxQuantile functions, here we use the DataFrame approxQuantile version
Ausgabe
SMA gibt die EWI SPRKPY1009 über die Zeile zurück, in der approxQuantile verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Use Snowpark approxQuantile method. Some parameters don’t match so they require some manual adjustments. for the output code’s example a recommended fix could be:
pyspark.sql.dataframe.DataFrame.approxQuantile’s relativeError-Parameter existiert nicht in SnowPark.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1010¶
Meldung: pyspark.sql.dataframe.DataFrame.checkpoint hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrame.checkpoint which has a workaround.
Szenario¶
Eingabe
In PySpark werden Checkpoints dazu verwendet, den logischen Plan eines Datenframes abzuschneiden, um das Anwachsen eines logischen Plans zu vermeiden.
Ausgabe
SMA returns the EWI SPRKPY1010 over the line where approxQuantile is used, so you can use to identify where to fix. Note that also marks the setCheckpointDir as unsupported, but a checpointed directory is not required for the fix.
Empfohlene Korrektur
Snowpark macht explizite Checkpoints überflüssig: Dies liegt daran, dass Snowpark mit SQL-basierten Operationen arbeitet, die von der Snowflake Abfrageoptimierungs-Engine optimiert werden, so dass keine unerfüllten Berechnungen oder außer Kontrolle geratene logische Pläne erforderlich sind.
However there could be scenarios where you would require persist the result of a computation on a dataframe. In this scenarios you can save materialize the results by writing the dataframe on a Snowflake Table or in a Snowflake Temporary Table.
Durch die Verwendung einer permanenten Tabelle oder des berechneten Ergebnisses kann jederzeit, auch nach dem Ende der Sitzung, darauf zugegriffen werden.
Eine alternative Lösung, die Verwendung einer temporären Tabelle, hat den Vorteil, dass die Tabelle nach Beendigung der Sitzung gelöscht wird:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1011¶
Meldung: pyspark.sql.dataframe.DataFrameStatFunctions.approxQuantile hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrameStatFunctions.approxQuantile which has a workaround.
Szenario¶
Eingabe
It’s important understand that Pyspark uses two different approxQuantile functions, here we use the DataFrameStatFunctions approxQuantile version.
Ausgabe
SMA gibt die EWI SPRKPY1011 über die Zeile zurück, in der approxQuantile verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
You can use Snowpark approxQuantile method. Some parameters don’t match so they require some manual adjustments. for the output code’s example a recommended fix could be:
pyspark.sql.dataframe.DataFrame.approxQuantile’s relativeError-Parameter existiert nicht in SnowPark.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1012¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.dataframe.DataFrameStatFunctions.writeTo hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrameStatFunctions.writeTo which has a workaround.
Szenario¶
Eingabe
In diesem Beispiel wird der Datenframe df in eine Spark-Tabelle „table“ geschrieben.
Ausgabe
SMA gibt die EWI SPRKPY1012 über die Zeile zurück, in der DataFrameStatFunctions.writeTo verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Verwenden Sie stattdessen df.write.SaveAsTable().
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1013¶
Meldung: pyspark.sql.functions.acosh hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.acosh which has a workaround.
Szenario¶
Eingabe
On this example pyspark calculates the acosh for a dataframe by using pyspark.sql.functions.acosh
Ausgabe
SMA gibt die EWI SPRKPY1013 über die Zeile zurück, in der acosh verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
There is no direct „acosh“ implementation but „call_function“ can be used instead, using „acosh“ as the first parameter, and colName as the second one.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1014¶
Meldung: pyspark.sql.functions.asinh hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.asinh which has a workaround.
Szenario¶
Eingabe
On this example pyspark calculates the asinh for a dataframe by using pyspark.sql.functions.asinh.
Ausgabe
SMA gibt die EWI SPRKPY1014 über die Zeile zurück, in der asinh verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
There is no direct „asinh“ implementation but „call_function“ can be used instead, using „asinh“ as the first parameter, and colName as the second one.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1015¶
Meldung: pyspark.sql.functions.atanh hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.atanh which has a workaround.
Szenario¶
Eingabe
On this example pyspark calculates the atanh for a dataframe by using pyspark.sql.functions.atanh.
Ausgabe
SMA gibt die EWI SPRKPY1015 über die Zeile zurück, in der atanh verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
There is no direct „atanh“ implementation but „call_function“ can be used instead, using „atanh“ as the first parameter, and colName as the second one.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1016¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 0.11.7
Meldung: pyspark.sql.functions.collect_set hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.collect_set which has a workaround.
Szenario¶
Eingabe
Using collect*set to get the elements of _colname* without duplicates:
Ausgabe
SMA gibt die EWI SPRKPY1016 über die Zeile zurück, in der collect_set verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Verwenden Sie die array_agg-Funktion, und fügen Sie ein zweites Argument mit dem True-Wert hinzu.
Zusätzliche Empfehlung¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1017¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
pyspark.sql.functions.date_add bietet eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.date_add which has a workaround.
Szenario¶
Eingabe
In diesem Beispiel verwenden wir date_add, um das Datum 5 Tage nach dem aktuellen Datum für den Datenframe df zu berechnen.
Ausgabe
SMA gibt die EWI SPRKPY1017 über die Zeile zurück, in der date_add verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Import snowflake.snowpark.functions, which contains an implementation for date_add (and alias dateAdd) function.
Zusätzliche Empfehlung¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1018¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Meldung: pyspark.sql.functions.date_sub bietet eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.date_sub which has a workaround.
Szenario¶
Eingabe
In diesem Beispiel verwenden wir date_add, um das Datum 5 Tage vor dem aktuellen Datum für den Datenframe df zu berechnen.
Ausgabe
SMA gibt die EWI SPRKPY1018 über die Zeile zurück, in der date_sub verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Import snowflake.snowpark.functions, which contains an implementation for date_sub function.
Zusätzliche Empfehlung¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1019¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Meldung: pyspark.sql.functions.datediff hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.datediff which has a workaround.
Szenario¶
Eingabe
In diesem Beispiel verwenden wir datediff, um die Tagesdifferenz von „heute“ und anderen Daten zu berechnen.
Ausgabe
SMA gibt die EWI SPRKPY1019 über die Zeile zurück, in der datediff verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
SMA convert pyspark.sql.functions.datediff onto snowflake.snowpark.functions.daydiff that also calculates the diference in days between two dates.
Empfohlene Korrektur
datediff(part: string ,end: ColumnOrName, start: ColumnOrName)
Action: Import snowflake.snowpark.functions, which contains an implementation for datediff function that requires an extra parameter for date time part and allows more versatility on calculate differences between dates.
Empfehlung¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1020¶
Meldung: pyspark.sql.functions.instr hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.instr which has a workaround.
Szenario¶
Eingabe
Hier ist ein einfaches Beispiel für die Verwendung von pyspark instr:
Ausgabe:
SMA gibt die EWI SPRKPY1020 über die Zeile zurück, in der instr verwendet wird, so dass Sie damit feststellen können, wo Sie korrigieren müssen.
Empfohlene Korrektur
Requires a manual change by using the function charindex and changing the order of the first two parameters.
Zusätzliche Empfehlung¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1021¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.last hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.last function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.last function that generates this EWI. In this example, the last function is used to get the last value for each name.
Ausgabe
The SMA adds the EWI SPRKPY1021 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the Snowflake LAST_VALUE function. To invoke this function from Snowpark, use the snowflake.snowpark.functions.call_builtin function and pass the string last_value as the first argument and the corresponding column as the second argument. If you were using the name of the column in the last function, you should convert it into a column when calling the call_builtin function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
description: >-
The mode parameter in the methods of CSV, JSON and PARQUET is transformed to
overwrite
SPRKPY1022¶
Meldung: pyspark.sql.functions.log10 hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log10 function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.log10 function that generates this EWI. In this example, the log10 function is used to calculate the base-10 logarithm of the value column.
Ausgabe
The SMA adds the EWI SPRKPY1022 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the snowflake.snowpark.functions.log function by passing the literal value 10 as the base.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1023¶
Meldung: pyspark.sql.functions.log1p hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log1p function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.log1p function that generates this EWI. In this example, the log1p function is used to calculate the natural logarithm of the value column.
Ausgabe
The SMA adds the EWI SPRKPY1023 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the call_function function by passing the string ln as the first argument and by adding 1 to the second argument.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1024¶
Meldung: pyspark.sql.functions.log2 hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log2 function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.log2 function that generates this EWI. In this example, the log2 function is used to calculate the base-2 logarithm of the value column.
Ausgabe
The SMA adds the EWI SPRKPY1024 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the snowflake.snowpark.functions.log function by passing the literal value 2 as the base.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1025¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.ntile hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.ntile function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.ntile function that generates this EWI. In this example, the ntile function is used to divide the rows into 3 buckets.
Ausgabe
The SMA adds the EWI SPRKPY1025 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
Snowpark has an equivalent ntile function, however, the argument pass to it should be a column. As a workaround, you can convert the literal argument into a column using the snowflake.snowpark.functions.lit function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1026¶
Warnung
This issue code has been deprecated since Spark Conversion Core 4.3.2
Meldung: pyspark.sql.readwriter.DataFrameReader. csv hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.csv function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.csv function that generates this EWI. In this example, the csv function is used to read multiple .csv files with a given schema and uses some extra options such as encoding, header and sep to fine-tune the behavior of reading the files.
Ausgabe
The SMA adds the EWI SPRKPY1026 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
In this section, we explain how to configure the path parameter, the schema parameter and some options to make them work in Snowpark.
1. Pfad Parameter
Snowpark requires the path parameter to be a stage location so, as a workaround, you can create a temporary stage and add each .csv file to that stage using the prefix file://.
2. Schema Parameter
Snowpark does not allow defining the schema as a parameter of the csv function. As a workaround, you can use the snowflake.snowpark.DataFrameReader.schema function.
3. Optionen Parameter
Snowpark does not allow defining the extra options as parameters of the csv function. As a workaround, for many of them you can use the snowflake.snowpark.DataFrameReader.option function to specify those parameters as options of the DataFrameReader.
Bemerkung
Die folgenden Optionen werden von Snowpark nicht unterstützt:
columnNameOfCorruptRecord
emptyValue
enforceSchema
Header
ignoreLeadingWhiteSpace
ignoreTrailingWhiteSpace
inferSchema
locale
maxCharsPerColumn
maxColumns
Modus (mode)
mehrzeilig
nanValue
negativInf
nullValue
positivInf
quoteAll
samplingRatio
timestampNTZFormat
unescapedQuoteHandling
Nachfolgend sehen Sie ein vollständiges Beispiel dafür, wie der Eingabecode nach Anwendung der oben genannten Vorschläge aussehen sollte, damit er in Snowpark funktioniert:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1027¶
Warnung
This issue code has been deprecated since Spark Conversion Core 4.5.2
Meldung: pyspark.sql.readwriter.DataFrameReader. json hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.json function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.json function that generates this EWI. In this example, the json function is used to read multiple .json files with a given schema and uses some extra options such as primitiveAsString and dateFormat to fine-tune the behavior of reading the files.
Ausgabe
The SMA adds the EWI SPRKPY1027 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
In this section, we explain how to configure the path parameter, the schema parameter and some options to make them work in Snowpark.
1. Pfad Parameter
Snowpark requires the path parameter to be a stage location so, as a workaround, you can create a temporary stage and add each .json file to that stage using the prefix file://.
2. Schema Parameter
Snowpark does not allow defining the schema as a parameter of the json function. As a workaround, you can use the snowflake.snowpark.DataFrameReader.schema function.
3. Optionen Parameter
Snowpark does not allow defining the extra options as parameters of the json function. As a workaround, for many of them you can use the snowflake.snowpark.DataFrameReader.option function to specify those parameters as options of the DataFrameReader.
Bemerkung
Die folgenden Optionen werden von Snowpark nicht unterstützt:
allowBackslashEscapingAnyCharacter
allowComments
allowNonNumericNumbers
allowNumericLeadingZero
allowSingleQuotes
allowUnquotedControlChars
allowUnquotedFieldNames
columnNameOfCorruptRecord
dropFiledIfAllNull
Codierung
ignoreNullFields
lineSep
locale
Modus (mode)
mehrzeilig
prefersDecimal
primitiveAsString
samplingRatio
timestampNTZFormat
timeZone
Nachfolgend sehen Sie ein vollständiges Beispiel dafür, wie der Eingabecode nach Anwendung der oben genannten Vorschläge aussehen sollte, damit er in Snowpark funktioniert:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1028¶
Meldung: pyspark.sql.readwriter.DataFrameReader.orc bietet eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.orc function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.orc function that generates this EWI. In this example, the orc function is used to read multiple .orc files and uses some extra options such as mergeSchema and recursiveFileLookup to fine-tune the behavior of reading the files.
Ausgabe
The SMA adds the EWI SPRKPY1028 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
In this section, we explain how to configure the path parameter and the extra options to make them work in Snowpark.
1. Pfad Parameter
Snowpark requires the path parameter to be a stage location so, as a workaround, you can create a temporary stage and add each .orc file to that stage using the prefix file://.
2. Optionen Parameter
Snowpark does not allow defining the extra options as parameters of the orc function. As a workaround, for many of them you can use the snowflake.snowpark.DataFrameReader.option function to specify those parameters as options of the DataFrameReader.
Bemerkung
Die folgenden Optionen werden von Snowpark nicht unterstützt:
Kompression
mergeSchema
Nachfolgend sehen Sie ein vollständiges Beispiel dafür, wie der Eingabecode nach Anwendung der oben genannten Vorschläge aussehen sollte, damit er in Snowpark funktioniert:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1029¶
Meldung: Dieses Problem tritt auf, wenn das Tool die Verwendung von pyspark.sql.readwriter.DataFrameReader.parquet erkennt Diese Funktion wird unterstützt, aber einige der Unterschiede zwischen Snowpark und Spark API erfordern möglicherweise einige manuelle Änderungen.
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.parquet function. This function is supported by Snowpark, however, there are some differences that would require some manual changes.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.parquet function that generates this EWI.
Ausgabe
The SMA adds the EWI SPRKPY1029 to the output code to let you know that this function is supported by Snowpark, but it requires some manual adjustments. Please note that the options supported by Snowpark are transformed into option function calls and those that are not supported are removed. This is explained in more detail in the next sections.
Empfohlene Korrektur
In this section, we explain how to configure the paths and options parameters to make them work in Snowpark.
1. paths-Parameter
In Spark, this parameter can be a local or cloud location. Snowpark only accepts cloud locations using a snowflake stage. So, you can create a temporal stage and add each file into it using the prefix file://.
2. Optionen Parameter
Snowpark does not allow defining the different options as parameters of the parquet function. As a workaround, you can use the option or options functions to specify those parameters as extra options of the DataFrameReader.
Bitte beachten Sie, dass die Snowpark options nicht genau mit den PySpark options übereinstimmen, so dass einige manuelle Änderungen erforderlich sein könnten. Nachfolgend finden Sie eine genauere Erklärung, wie Sie die gängigsten PySpark-Optionen in Snowpark konfigurieren.
2.1 mergeSchema Option
Parquet supports schema evolution, allowing users to start with a simple schema and gradually add more columns as needed. This can result in multiple parquet files with different but compatible schemas. In Snowflake, thanks to the infer_schema capabilities you don’t need to do that and therefore the mergeSchema option can just be removed.
2.2 pathGlobFilter Option
If you want to load only a subset of files from the stage, you can use the pattern option to specify a regular expression that matches the files you want to load. The SMA already automates this as you can see in the output of this scenario.
2.3 recursiveFileLookupstr Option
This option is not supported by Snowpark. The best recommendation is to use a regular expression like with the pathGlobFilter option to achieve something similar.
2.4 modifiedBefore / modifiedAfter-Option
You can achieve the same result in Snowflake by using the metadata columns.
Bemerkung
Die folgenden Optionen werden von Snowpark nicht unterstützt:
Kompression
datetimeRebaseMode
int96RebaseMode
mergeSchema
Nachfolgend finden Sie ein vollständiges Beispiel dafür, wie der Eingabecode umgewandelt werden sollte, damit er in Snowpark funktioniert:
Zusätzliche Empfehlungen¶
In Snowflake können Sie andere Ansätze für die Aufnahme von Parquet-Daten nutzen, wie z. B:
Leveraging native parquet ingestion capabilities. Consider also autoingest with snowpipe.
Parquet external tables which can be pointed directly to cloud file locations.
Using Iceberg tables.
Bei einer Migration empfiehlt es sich, die SMA-Berichte zu nutzen, um eine Bestandsaufnahme der Dateien vorzunehmen und zu ermitteln, welchen Stagingbereichen/Tabellen die Daten nach der Modernisierung zugeordnet werden sollen.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1030¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.session.SparkSession.Builder.appName hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.session.SparkSession.Builder.appName function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.session.SparkSession.Builder.appName function that generates this EWI. In this example, the appName function is used to set MyApp as the name of the application.
Ausgabe
The SMA adds the EWI SPRKPY1030 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can import the snowpark_extensions package which provides an extension for the appName function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1031¶
Warnung
This issue code has been deprecated since Spark Conversion Core 2.7.0
Meldung: pyspark.sql.column.Column.contains hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.contains function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.column.Column.contains function that generates this EWI. In this example, the contains function is used to filter the rows where the ‚City‘ column contains the substring ‚New‘.
Ausgabe
The SMA adds the EWI SPRKPY1031 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the snowflake.snowpark.functions.contains function by passing the column as the first argument and the element to search as the second argument. If the element to search is a literal value then it should be converted into a column expression using the lit function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1032¶
Message: *spark element* is not defined
Kategorie: Konvertierungsfehler
Beschreibung¶
Dieses Problem tritt auf, wenn SMA keinen geeigneten Zuordnungsstatus für das angegebene Element ermitteln konnte. Das bedeutet, dass SMA noch nicht weiß, ob dieses Element von Snowpark unterstützt wird oder nicht. Bitte beachten Sie, dass dies ein allgemeiner Fehlercode ist, der von SMA für jedes nicht definierte Element verwendet wird.
Szenario¶
Eingabe
Below is an example of a function for which the SMA could not determine an appropriate mapping status. In this case, you should assume that not_defined_function() is a valid PySpark function and the code runs.
Ausgabe
The SMA adds the EWI SPRKPY1032 to the output code to let you know that this element is not defined.
Empfohlene Korrektur
Um zu versuchen, das Problem zu identifizieren, können Sie die folgenden Überprüfungen durchführen:
Prüfen Sie, ob der Quellcode die richtige Syntax hat und richtig geschrieben ist.
Check if you are using a PySpark version supported by the SMA. To know which PySpark version is supported by the SMA at the moment of running the SMA, you can review the first page of the
DetailedReport.docxfile.
If this is a valid PySpark element, please report that you encountered a conversion error on that particular element using the Report an Issue option of the SMA and include any additional information that you think may be helpful.
Please note that if an element is not defined, it does not mean that it is not supported by Snowpark. You should check the Snowpark Documentation to verify if an equivalent element exist.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1033¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.asc hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.asc function, which has a workaround.
Szenarien¶
The pyspark.sql.functions.asc function takes either a column object or the name of the column as a string as its parameter. Both scenarios are not supported by Snowpark so this EWI is generated.
Szenario 1¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.asc function that takes a column object as parameter.
Ausgabe
The SMA adds the EWI SPRKPY1033 to the output code to let you know that the asc function with a column object parameter is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can call the snowflake.snowpark.Column.asc function from the column parameter.
Szenario 2¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.asc function that takes the name of the column as parameter.
Ausgabe
The SMA adds the EWI SPRKPY1033 to the output code to let you know that the asc function with a column name parameter is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can convert the string parameter into a column object using the snowflake.snowpark.functions.col function and then call the snowflake.snowpark.Column.asc function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1034¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.desc hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.desc function, which has a workaround.
Szenarien¶
The pyspark.sql.functions.desc function takes either a column object or the name of the column as a string as its parameter. Both scenarios are not supported by Snowpark so this EWI is generated.
Szenario 1¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.desc function that takes a column object as parameter.
Ausgabe
The SMA adds the EWI SPRKPY1034 to the output code to let you know that the desc function with a column object parameter is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can call the snowflake.snowpark.Column.desc function from the column parameter.
Szenario 2¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.desc function that takes the name of the column as parameter.
Ausgabe
The SMA adds the EWI SPRKPY1034 to the output code to let you know that the desc function with a column name parameter is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can convert the string parameter into a column object using the snowflake.snowpark.functions.col function and then call the snowflake.snowpark.Column.desc function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1035¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.reverse hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.reverse function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.reverse function that generates this EWI. In this example, the reverse function is used to reverse each string of the word column.
Ausgabe
The SMA adds the EWI SPRKPY1035 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can import the snowpark_extensions package which provides an extension for the reverse function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1036¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.column.Column.getField hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.getField function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.column.Column.getField function that generates this EWI. In this example, the getField function is used to extract the name from the info column.
Ausgabe
The SMA adds the EWI SPRKPY1036 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use the Snowpark column indexer operator with the name of the field as the index.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1037¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.sort_array hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.sort_array function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.sort_array function that generates this EWI. In this example, the sort_array function is used to sort the numbers array in ascending and descending order.
Ausgabe
The SMA adds the EWI SPRKPY1037 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can import the snowpark_extensions package which provides an extension for the sort_array function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1038¶
Message: *spark element* is not yet recognized
Kategorie: Konvertierungsfehler
Beschreibung¶
Dieses Problem tritt auf, wenn es ein PySpark-Element in Ihrem Quellcode gibt, das von SMA nicht erkannt wurde. Dies kann verschiedene Gründe haben, wie zum Beispiel:
Ein Element, das in PySpark nicht existiert.
Ein Element, das in einer Version von PySpark hinzugefügt wurde, die von SMA noch nicht unterstützt wird.
Ein interner Fehler des SMA bei der Verarbeitung des Elements.
Dies ist ein allgemeiner Fehlercode, der von SMA für jedes nicht erkannte Element verwendet wird.
Szenario¶
Eingabe
Nachfolgend finden Sie ein Beispiel für die Verwendung einer Funktion, die von SMA nicht erkannt werden konnte, weil sie in PySpark nicht existiert.
Ausgabe
The SMA adds the EWI SPRKPY1038 to the output code to let you know that this element could not be recognized.
Empfohlene Korrektur
Um zu versuchen, das Problem zu identifizieren, können Sie die folgenden Überprüfungen durchführen:
Prüfen Sie, ob das Element in PySpark existiert.
Prüfen Sie, ob das Element richtig geschrieben ist.
Check if you are using a PySpark version supported by the SMA. To know which PySpark version is supported by the SMA at the moment of running the SMA, you can review the first page of the
DetailedReport.docxfile.
If it is a valid PySpark element, please report that you encountered a conversion error on that particular element using the Report an Issue option of the SMA and include any additional information that you think may be helpful.
Please note that if an element could not be recognized by the SMA, it does not mean that it is not supported by Snowpark. You should check the Snowpark Documentation to verify if an equivalent element exist.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1039¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.column.Column.getItem hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.getItem function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.column.Column.getItem function that generates this EWI. In this example, the getItem function is used to get an item by position and by key.
Ausgabe
The SMA adds the EWI SPRKPY1039 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
Als Problemumgehung können Sie den Snowpark-Spaltenindexierungsoperator mit dem Namen oder der Position des Feldes als Index verwenden.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1040¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.functions.explode hat eine Problemumgehung, siehe Dokumentation für weitere Informationen
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.explode function, which has a workaround.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.functions.explode function that generates this EWI. In this example, the explode function is used to generate one row per array item for the numbers column.
Ausgabe
The SMA adds the EWI SPRKPY1040 to the output code to let you know that this function is not directly supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can import the snowpark_extensions package which provides an extension for the explode function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1041¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.9.0
Meldung: pyspark.sql.functions.explode_outer hat eine Problemumgehung
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.explode_outer which has a workaround.
Szenario¶
Eingabe
Das Beispiel zeigt die Verwendung der explode_outer-Methode in einem Auswahl-Aufruf.
Ausgabe
The tool adds the EWI SPRKPY1041 indicating that a workaround can be implemented.
Empfohlene Korrektur
As a workaround, you can import the snowpark_extensions package, which contains a helper for the explode_outer function.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1042¶
Meldung: pyspark.sql.functions.posexplode hat eine Problemumgehung
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.posexplode which has a workaround.
Szenarien¶
There are a couple of scenarios that this method can handle depending on the type of column it is passed as a parameter, it can be a list of values or a map/directory (keys/values).
Szenario 1¶
Eingabe
Below is an example of the usage of posexplode passing as a parameter of a list of values.
Ausgabe
The tool adds the EWI SPRKPY1042 indicating that a workaround can be implemented.
Empfohlene Korrektur
For having the same behavior, use the method functions.flatten, drop extra columns, and rename index and value column names.
Szenario 2¶
Eingabe
Below is another example of the usage of posexplode passing as a parameter a map/dictionary (keys/values)
Ausgabe
The tool adds the EWI SPRKPY1042 indicating that a workaround can be implemented.
Empfohlene Korrektur
As a workaround, you can use functions.row_number to get the position and functions.explode with the name of the field to get the value the key/value for dictionaries.
Hinweis: mit „row_number“ ist nicht vollständig äquivalent, da es mit 1 beginnt (nicht mit Null wie die Spark-Methode)
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1043¶
Meldung: pyspark.sql.functions.posexplode_outer hat eine Problemumgehung
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.posexplode_outer which has a workaround.
Szenarien¶
There are a couple of scenarios that this method can handle depending on the type of column it is passed as a parameter, it can be a list of values or a map/directory (keys/values).
Szenario 1¶
Eingabe
Below is an example that shows the usage of posexplode_outer passing a list of values.
Ausgabe
The tool adds the EWI SPRKPY1043 indicating that a workaround can be implemented.
Empfohlene Korrektur
For having the same behavior, use the method functions.flatten sending the outer parameter in True, drop extra columns, and rename index and value column names.
Szenario 2¶
Eingabe
Nachfolgend ein weiteres Beispiel für die Verwendung von posexplode_outer, das map/dictionary (keys/values) übergibt
Ausgabe
The tool adds the EWI SPRKPY1043 indicating that a workaround can be implemented.
Empfohlene Korrektur
As a workaround, you can use functions.row_number to get the position and functions.explode_outer with the name of the field to get the value of the key/value for dictionaries.
Hinweis: mit „row_number“ ist nicht vollständig äquivalent, da es mit 1 beginnt (nicht mit Null wie die Spark-Methode)
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1044¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
Meldung: pyspark.sql.functions.split hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.split which has a workaround.
Szenarien¶
Es gibt mehrere Szenarien, die von der Anzahl der an die Methode übergebenen Parameter abhängen.
Szenario 1¶
Eingabe
Below is an example when the function split has just the str and pattern parameters
Ausgabe
The tool shows the EWI SPRKPY1044 indicating there is a workaround.
Empfohlene Korrektur
As a workaround, you can call the function snowflake.snowpark.functions.lit with the pattern parameter and send it into the split.
Szenario 2¶
Eingabe
Below is another example when the function split has the str, pattern, and limit parameters.
Ausgabe
The tool shows the EWI SPRKPY1044 indicating there is a workaround.
Empfohlene Korrektur
Dieses spezielle Szenario wird nicht unterstützt.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1045¶
Meldung: pyspark.sql.functions.map_values hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
Diese Funktion wird verwendet, um die Liste der Werte aus einer Spalte zu extrahieren, die eine map/dictionary (keys/values) enthält.
The issue appears when the tool detects the usage of pyspark.sql.functions.map_values which has a workaround.
Szenario¶
Eingabe
Below is an example of the usage of the method map_values.
Ausgabe
The tool adds the EWI SPRKPY1045 indicating that a workaround can be implemented.
Empfohlene Korrektur
As a workaround, you can create an udf to get the values for a column. The below example shows how to create the udf, then assign it to F.map_values, and then make use of it.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1046¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.1.22
Meldung: pyspark.sql.functions.monotonically_increasing_id hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.monotonically_increasing_id which has a workaround.
Szenario¶
Eingabe
Below is an example of the usage of the method monotonically_increasing_id.
Ausgabe
The tool adds the EWI SPRKPY1046 indicating that a workaround can be implemented.
Empfohlene Korrektur
Aktualisieren Sie die Toolversion.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1047¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 4.6.0
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.context.SparkContext.setLogLevel which has a workaround.
Szenario¶
Eingabe
Below is an example of the usage of the method setLogLevel.
Ausgabe
The tool adds the EWI SPRKPY1047 indicating that a workaround can be implemented.
Empfohlene Korrektur
Replace the setLogLevel function usage with logging.basicConfig that provides a set of convenience functions for simple logging usage. In order to use it, we need to import two modules, „logging“ and „sys“, and the level constant should be replaced using the „Level equivalent table“:
Ebenen-Äquivalent-Tabelle
Ebenen-Quellen-Parameter |
Ebenen-Ziel-Parameter |
|---|---|
„ALL“ |
<mark style=“color:red;“>**This has no equivalent**</mark> |
„DEBUG“ |
Protokollieren.DEBUG |
„ERROR“ |
Protokollieren.ERROR |
„FATAL“ |
Protokollieren.CRITICAL |
„INFO“ |
Protokollieren.INFO |
„OFF“ |
Protokollieren.NOTSET |
„TRACE“ |
<mark style=“color:red;“>**This has no equivalent**</mark> |
„WARN“ |
Protokollieren.WARNING |
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1048¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
Meldung: pyspark.sql.session.SparkSession. conf hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.conf which has a workaround.
Szenario¶
Eingabe
Below is an example of how to set a configuration into the property conf .
Ausgabe
The tool adds the EWI SPRKPY1048 indicating that a workaround can be implemented.
Empfohlene Korrektur
SparkSession.conf wird verwendet, um einige spezielle Einstellungen zu übergeben, die nur von Pyspark verwendet werden und nicht für Snowpark gelten. Sie können den Code entfernen oder kommentieren
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1049¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.1.9
Meldung: pyspark.sql.session.SparkSession.sparkContext hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.sparkContext which has a workaround.
Szenario¶
Eingabe
Below is an example that creates a spark session and then uses the SparkContext property to print the appName.
Ausgabe
The tool adds the EWI SPRKPY1049 indicating that a workaround can be implemented.
Empfohlene Korrektur
SparkContext wird in SnowPark nicht unterstützt, aber Sie können auf die Methoden und Eigenschaften von SparkContext direkt von der Sitzungsinstanz aus zugreifen.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1050¶
Meldung: pyspark.conf.SparkConf. set hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf.set which has a workaround.
Szenario¶
Eingabe
Below is an example that sets a variable using conf.set.
Ausgabe
The tool adds the EWI SPRKPY1050 indicating that a workaround can be implemented.
Empfohlene Korrektur
SparkConf.set wird verwendet, um eine Konfigurationseinstellung zu setzen, die nur von Pyspark verwendet wird und nicht für Snowpark gilt. Sie können den Code entfernen oder kommentieren
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1051¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
Meldung: pyspark.sql.session.SparkSession.Builder.master hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects pyspark.sql.session.SparkSession.Builder.master usage which has a workaround.
Szenario¶
Eingabe
Below is an example of the usage of the method builder.master to set the Spark Master URL to connect to local using 1 core.
Ausgabe
The tool adds the EWI SPRKPY1051 indicating that a workaround can be implemented.
Empfohlene Korrektur
pyspark.sql.session.SparkSession.Builder.master is used to set up a Spark Cluster. Snowpark doesn’t use Spark Clusters so you can remove or comment the code.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1052¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.8.0
Meldung: pyspark.sql.session.SparkSession.Builder.enableHiveSupport hat eine Problemumgehung
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.Builder.enableHiveSupport which has a workaround.
Szenario¶
Eingabe
Below is an example that configures the SparkSession and enables the hive support using the method enableHiveSupport.
Ausgabe
The tool adds the EWI SPRKPY1052 indicating that a workaround can be implemented.
Empfohlene Korrektur
Remove the use of enableHiveSupport function because it is not needed in Snowpark.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1053¶
Meldung: Beim Extrahieren der dbc-Dateien ist ein Fehler aufgetreten.
Kategorie: Warnung.
Beschreibung¶
Dieses Problem tritt auf, wenn eine dbc-Datei nicht extrahiert werden kann. Diese Warnung könnte durch einen oder mehrere der folgenden Gründe verursacht werden: Zu schwer, unzugänglich, schreibgeschützt, usw.
Zusätzliche Empfehlungen¶
Als Problemumgehung können Sie die Größe der Datei überprüfen, wenn sie zu groß ist, um verarbeitet zu werden. Analysieren Sie auch, ob das Tool darauf zugreifen kann, um Zugriffsprobleme zu vermeiden.
Wenn Sie weitere Unterstützung benötigen, können Sie uns eine E-Mail an snowconvert-info@snowflake.com senden. Wenn Sie einen Supportvertrag mit Snowflake abgeschlossen haben, wenden Sie sich an Ihren Vertriebsingenieur, der Ihren Supportbedarf ermitteln kann.
SPRKPY1080¶
Meldung: Der Wert von SparkContext wird durch die Variable ‚session‘ ersetzt.
Kategorie: Warnung
Beschreibung¶
Der Spark-Kontext wird in einer Variablen namens „session“ gespeichert, die eine Snowpark-Sitzung erstellt.
Szenario¶
Eingabe
Dieser Codeausschnitt beschreibt ein SparkContext
Ausgabe
In diesem Ausgabecode hat SMA die PySpark.SparkContext durch eine SparkSession ersetzt. Beachten Sie, dass SMA auch eine Vorlage hinzufügt, um die Verbindung in der „connection.json“-Datei zu ersetzen und diese Konfiguration dann in die connection_parameter-Variable zu laden.
Empfohlene Korrektur
Die „connection.json“-Konfigurationsdatei muss mit den erforderlichen Verbindungsinformationen aktualisiert werden:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1054¶
Meldung: pyspark.sql.readwriter.DataFrameReader.format wird nicht unterstützt.
Kategorie: Warnung.
Beschreibung¶
This issue appears when the pyspark.sql.readwriter.DataFrameReader.format has an argument that is not supported by Snowpark.
Szenarien¶
There are some scenarios depending on the type of format you are trying to load. It can be a supported , or non-supported format.
Szenario 1¶
Eingabe
Das Tool analysiert den Typ des Formats, das Sie zu laden versuchen, die unterstützten Formate sind:
Csv
JSON
Parquet
Orc
The below example shows how the tool transforms the format method when passing a Csv value.
Ausgabe
The tool transforms the format method into a Csv method call.
Empfohlene Korrektur
In diesem Fall zeigt das Tool die EWI nicht an, d. h. es ist keine Korrektur erforderlich.
Szenario 2¶
Eingabe
The below example shows how the tool transforms the format method when passing a Jdbc value.
Ausgabe
The tool shows the EWI SPRKPY1054 indicating that the value „jdbc“ is not supported.
Empfohlene Korrektur
For the not supported scenarios, there is no specific fix since it depends on the files that are trying to be read.
Szenario 3¶
Eingabe
The below example shows how the tool transforms the format method when passing a CSV, but using a variable instead.
Ausgabe
Since the tool can not determine the value of the variable in runtime, shows the EWI SPRKPY1054 indicating that the value „“ is not supported.
Empfohlene Korrektur
As a workaround, you can check the value of the variable and add it as a string to the format call.
Zusätzliche Empfehlungen¶
The Snowpark location only accepts cloud locations using a snowflake stage.
The documentation of methods supported by Snowpark can be found in the documentation
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1055¶
Meldung: pyspark.sql.readwriter.DataFrameReader.option key value wird nicht unterstützt.
Kategorie: Warnung.
Beschreibung¶
This issue appears when the pyspark.sql.readwriter.DataFrameReader.option key value is not supported by SnowFlake.
Das Tool analysiert die Parameter des Optionsaufrufs, und je nach Methode (CSV oder JSON oder PARQUET) kann der Schlüsselwert eine Äquivalenz in Snowpark haben oder nicht. Wenn alle Parameter eine Äquivalenz haben, fügt das Tool die EWI nicht hinzu und ersetzt den Schlüsselwert durch sein Äquivalentes, andernfalls fügt das Tool die EWI hinzu.
Liste der Äquivalenzen:
Äquivalenzen für CSV:
Spark-Optionstasten |
Snowpark-Äquivalenzen |
|---|---|
sep |
FIELD_DELIMITER |
Header |
PARSE_HEADER |
lineSep |
RECORD_DELIMITER |
pathGlobFilter |
PATTERN |
Anführungszeichen |
FIELD_OPTIONALLY_ENCLOSED_BY |
nullValue |
NULL_IF |
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
inferSchema |
INFER_SCHEMA |
Trennzeichen |
FIELD_DELIMITER |
Äquivalenzen für JSON:
Spark-Optionstasten |
Snowpark-Äquivalenzen |
|---|---|
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
pathGlobFilter |
PATTERN |
Äquivalenzen für PARQUET:
Spark-Optionstasten |
Snowpark-Äquivalenzen |
|---|---|
pathGlobFilter |
PATTERN |
Alle anderen Schlüsseloptionen, die nicht in einer der oben genannten Tabellen enthalten sind, werden nicht unterstützt oder haben keine Äquivalenten in Snowpark. Wenn das der Fall ist, fügt das Tool die EWI mit den Parameterinformationen hinzu und entfernt sie aus der Kette.
Szenarien¶
Die folgenden Szenarien gelten für CSV, JSON und PARQUET.
There are a couple of scenarios depending on the value of the key used in the option method.
Szenario 1¶
Eingabe
Below is an example of a option call using a equivalent key.
Ausgabe
Das Tool wandelt den Schlüssel in das richtige Äquivalent um.
Empfohlene Korrektur
Da das Tool den Wert des Schlüssels umwandelt, ist eine Korrektur nicht erforderlich.
Szenario 2¶
Eingabe
Below is an example of a option call using a non-equivalent key.
Ausgabe
The tool adds the EWI SPRKPY1055 indicating the key is not supported and removes the option call.
Empfohlene Korrektur
Es wird empfohlen, die Verhaltensweise nach der Umwandlung zu überprüfen.
Zusätzliche Empfehlungen¶
Wenn nicht-äquivalente Parameter vorhanden sind, empfiehlt es sich, die Verhaltensweise nach der Umwandlung zu überprüfen.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1056¶
Warnung
Dieser Problemcode ist jetzt veraltet
Meldung: pyspark.sql.readwriter.DataFrameReader.option argument _ <argument_name> _ ist kein Literal und kann nicht ausgewertet werden
Kategorie: Warnung
Beschreibung¶
This issue appears when the argument’s key or value of the pyspark.sql.readwriter.DataFrameReader.option function is not a literal value (for example a variable). The SMA does a static analysis of your source code, and therefore it is not possible to evaluate the content of the argument.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.option function that generates this EWI.
Ausgabe
The SMA adds the EWI SPRKPY1056 to the output code to let you know that the argument of this function is not a literal value, and therefore it could not be evaluated by the SMA.
Empfohlene Korrektur
Even though the SMA was unable to evaluate the argument, it does not mean that it is not supported by Snowpark. Please make sure that the value of the argument is valid and equivalent in Snowpark by checking the documentation.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1057¶
Warnung
This Issue Code has been deprecated since Spark Conversion Core Version 4.8.0
Message: PySpark Dataframe Option argument contains a value that is not a literal, therefore cannot be evaluated
Kategorie: Warnung.
Beschreibung¶
Dieser Ausgabecode ist veraltet. Wenn Sie eine ältere Version verwenden, führen Sie ein Upgrade auf die neueste Version aus.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1058¶
Meldung: < Methode > mit < Schlüssel > Plattformspezifischer Schlüssel wird nicht unterstützt.
Kategorie: ConversionError
Beschreibung¶
The get and set methods from pyspark.sql.conf.RuntimeConfig are not supported with a Platform specific key.
Szenarien¶
Not all usages of get or set methods are going to have an EWI in the output code. This EWI appears when the tool detects the usage of these methods with a Platform specific key which is not supported.
Szenario 1¶
Eingabe
Below is an example of the get or set methods with supported keys in Snowpark.
Ausgabe
Da die Schlüssel in Snowpark unterstützt werden, fügt das Tool die EWI nicht in den Ausgabecode ein.
Empfohlene Korrektur
Für dieses Szenario gibt es keine empfohlene Lösung.
Szenario 2¶
Eingabe
Nachfolgend finden Sie ein Beispiel mit nicht unterstützten Schlüsseln.
Ausgabe
The tool adds this EWI SPRKPY1058 on the output code to let you know that these methods are not supported with a Platform specific key.
Empfohlene Korrektur
Die empfohlene Korrektur ist, diese Methoden zu entfernen.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1059¶
Warnung
This issue code has been deprecated since Spark Conversion Core Version 2.45.1
Message: pyspark.storagelevel.StorageLevel has a workaround, see documentation.
Kategorie: Warnung
Beschreibung¶
Currently, the use of StorageLevel is not required in Snowpark since Snowflake controls the storage. For more information, you can refer to the EWI SPRKPY1072
Zusätzliche Empfehlungen¶
Aktualisieren Sie Ihre Anwendung auf die neueste Version.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1060¶
Meldung: Der Authentifizierungsmechanismus ist connection.json (Vorlage vorhanden).
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf.
Szenario¶
Eingabe
Da der Authentifizierungsmechanismus in Snowpark anders ist, entfernt das Tool die Verwendungen und erstellt stattdessen eine Verbindungskonfigurationsdatei (connection.json).
Ausgabe
The tool adds the EWI SPRKPY1060 indicating that the authentication mechanism is different.
Empfohlene Korrektur
To create a connection it is necessary that you fill in the information in the connection.json file.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1061¶
Meldung: Snowpark unterstützt keine unix_timestamp-Funktionen
Kategorie: Warnung
Beschreibung¶
In Snowpark, the first parameter is mandatory; the issue appears when the tool detects the usage of pyspark.sql.functions.unix_timestamp with no parameters.
Szenario¶
Eingabe
Below an example that calls the unix_timestamp method without parameters.
Ausgabe
The Snowpark signature for this function unix_timestamp(e: ColumnOrName, fmt: Optional["Column"] = None), as you can notice the first parameter it’s required.
The tool adds this EWI SPRKPY1061 to let you know that function unix_timestamp with no parameters it’s not supported in Snowpark.
Empfohlene Korrektur
Als Problemumgehung können Sie zumindest den Namen oder die Spalte der Zeitstempelzeichenfolge hinzufügen.
Zusätzliche Empfehlungen¶
You also can add the current_timestamp() as the first parameter.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1062¶
Meldung: Snowpark unterstützt GroupedData.pivot nicht ohne den Parameter „values“.
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects the usage of the pyspark.sql.group.GroupedData.pivot function without the „values“ parameter (the list of values to pivot on).
Im Moment erfordert die Snowpark Python Pivot-Funktion, dass Sie explizit die Liste der unterschiedlichen Werte angeben, an denen ein Pivot ausgeführt werden soll werden soll.
Szenarien¶
Szenario 1¶
Eingabe
The SMA detects an expression that matches the pattern dataFrame.groupBy("columnX").pivot("columnY") and the pivot does not have the values parameter.
Ausgabe
Die SMA fügt eine EWI Meldung hinzu, die darauf hinweist, dass die Pivot-Funktion ohne den Parameter „values“ nicht unterstützt wird.
Außerdem fügt es als zweiten Parameter der Pivot-Funktion eine Listenkomprimierung hinzu, das die Liste der Werte berechnet, die in Spalten umgewandelt werden sollen. Denken Sie daran, dass dieser Vorgang bei großen Datensätzen nicht effizient ist, und es ist ratsam, die Werte explizit anzugeben.
Empfohlene Korrektur
Für dieses Szenario fügt SMA als zweiten Parameter der Pivot-Funktion eine Listenkomprimierung hinzu, das die Liste der Werte berechnet, die in Spalten umgewandelt werden, aber Sie können auch eine Liste eindeutiger Werte zur Pivot-Ausführung angeben. Gehen Sie wie folgt vor:
Szenario 2¶
Eingabe
The SMA couldn’t detect an expression that matches the pattern dataFrame.groupBy("columnX").pivot("columnY") and the pivot does not have the values parameter.
Ausgabe
Die SMA fügt eine EWI Meldung hinzu, die darauf hinweist, dass die Pivot-Funktion ohne den Parameter „values“ nicht unterstützt wird.
Empfohlene Korrektur
Fügen Sie eine Liste eindeutiger Werte hinzu, nach denen ein Pivot ausgeführt werden soll. Gehen Sie wie folgt vor:
Zusätzliche Empfehlungen¶
Die Berechnung der Liste eindeutiger Werte für die Pivot-Funktion ist bei großen Datensätzen nicht effizient und kann zu einem blockierenden Aufruf werden. Bitte überlegen Sie, ob Sie die Liste der unterschiedlichen Werte, auf die Sie ein Pivot ausführen möchten, explizit angeben möchten.
Wenn Sie die Liste der eindeutigen Werte für die Pivot-Funktion nicht explizit angeben möchten (was nicht ratsam ist), können Sie den folgenden Code als zweites Argument der Pivot-Funktion hinzufügen, um die Werte zur Laufzeit zu ermitteln*
****Replace*** :code:`<df>` with the corresponding DataFrame, with the column to pivot and with the number of rows to select.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1063¶
Meldung: pyspark.sql.pandas.functions.pandas_udf bietet eine Problemumgehung.
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.pandas.functions.pandas_udf which has a workaround.
Szenario¶
Eingabe
Die Funktion pandas_udf wird verwendet, um eine benutzerdefinierte Funktion zu erstellen, die mit großen Datenmengen arbeitet.
Ausgabe
Die SMA fügt eine EWI-Meldung hinzu, die darauf hinweist, dass pandas_udf über eine Problemumgehung verfügt.
Empfohlene Korrektur
Specify explicitly the parameters types as a new parameter input_types, and remove functionType parameter if applies. Created function must be called inside a select statement.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1064¶
Message: The *Spark element* does not apply since snowflake uses snowpipe mechanism instead.
Kategorie: Warnung
Beschreibung¶
Dieses Problem tritt auf, wenn das Tool die Verwendung eines Elements aus der pyspark.streaming-Bibliothek erkennt:
pyspark.streaming.listener.StreamingListener.
Szenario¶
Eingabe
Nachfolgend sehen Sie ein Beispiel mit einem der Elemente, die diesen EWI auslösen.
Ausgabe
The SMA adds the EWI SPRKPY1064 on the output code to let you know that this function does not apply.
Empfohlene Korrektur
The SMA removes the import statement and adds the issue to the Issues.csv inventory, remove any usages of the Spark element.
Zusätzliche Empfehlungen¶
Check the documentation for Snowpipe to see how it fits to the current scenario.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1065¶
Meldung: Der pyspark.context.SparkContext.broadcast trifft nicht zu, da Snowflake einen Mechanismus für das Clustering von Daten verwendet, um die Daten zu berechnen.
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of element pyspark.context.SparkContext.broadcast, which is not necessary due to the use of data-clustering of Snowflake.
Eingabecode
In diesem Beispiel wird eine Broadcast-Variable erstellt. Diese Variablen ermöglichen eine effizientere gemeinsame Nutzung von Daten durch alle Knotenpunkte.
Ausgabecode
Die SMA fügt eine EWI-Meldung hinzu, die besagt, dass die Übertragung nicht erforderlich ist.
Empfohlene Korrektur
Entfernen Sie alle Verwendungen von pyspark.context.SparkContext.broadcast.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1066¶
Meldung: Das Spark-Element trifft nicht zu, da Snowflake automatisch einen Mechanismus zur Mikropartitionierung verwendet.
Kategorie: Warnung
Beschreibung¶
Dieses Problem tritt auf, wenn das Tool die Verwendung von Elementen in Verbindung mit Partitionen erkennt:
Those elements do not apply due the use of micro-partitions of Snowflake.
Eingabecode
In this example sortWithinPartitions it’s used to create a partition in a DataFrame sorted by the specified column.
Ausgabecode
Die SMA fügt eine EWI-Meldung hinzu, die darauf hinweist, dass das Spark-Element nicht erforderlich ist.
Empfohlene Korrektur
Entfernen Sie die Verwendung des Elements.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1067¶
Meldung: Die Funktion pyspark.sql.functions.split hat Parameter, die in Snowpark nicht unterstützt werden.
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.split with more than two parameters or a regex pattern as a parameter; both cases are not supported.
Szenarien¶
Szenario 1¶
Eingabecode
In diesem Beispiel hat die Split-Funktion mehr als zwei Parameter.
Ausgabecode
Das Tool fügt diese EWI in den Ausgabecode ein, um Sie darauf hinzuweisen, dass diese Funktion nicht unterstützt wird, wenn sie mehr als zwei Parameter hat.
Empfohlene Korrektur
Behalten Sie die Split-Funktion mit nur zwei Parametern bei.
Szenario 2¶
Eingabecode
In diesem Beispiel hat die Split-Funktion ein Regex-Muster als Parameter.
Ausgabecode
Das Tool fügt diese EWI in den Ausgabecode ein, um Sie darauf hinzuweisen, dass diese Funktion nicht unterstützt wird, wenn sie ein Regex-Muster als Parameter hat.
Empfohlene Korrektur
The spark signature for this method functions.split(str: ColumnOrName, pattern: str, limit: int = - 1) not exactly match with the method in Snowpark functions.split(str: Union[Column, str], pattern: Union[Column, str]) so for now the scenario using regular expression does not have a recommended fix.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1068¶
Meldung: toPandas enthält Spalten vom Typ ArrayType, der nicht unterstützt wird und für den es eine Problemumgehung gibt.
Kategorie: Warnung
Beschreibung¶
pyspark.sql.DataFrame.toPandas doesn’t work properly If there are columns of type ArrayType. The workaround for these cases is converting those columns into a Python Dictionary by using json.loads method.
Szenario¶
Eingabe
ToPandas gibt die Daten der ursprünglichen DataFrame als Pandas DataFrame zurück.
Ausgabe
Das Tool fügt diese EWI hinzu, um Sie darauf hinzuweisen, dass toPandas nicht unterstützt wird, wenn es Spalten des Typs ArrayType gibt, bietet aber eine Problemumgehung.
Empfohlene Korrektur
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1069¶
Meldung: Wenn der partitionBy-Parameter eine Liste ist, wird Snowpark einen Fehler ausgeben.
Kategorie: Warnung
Beschreibung¶
When there is a usage of pyspark.sql.readwriter.DataFrameWriter.parquet method where it comes to the parameter partitionBy, the tool shows the EWI.
This is because in Snowpark the DataFrameWriter.parquet only supports a ColumnOrSqlExpr as a partitionBy parameter.
Szenarien¶
Szenario 1¶
Eingabecode:
In diesem Szenario ist der partitionBy-Parameter keine Liste.
Ausgabecode:
The tool adds the EWI SPRKPY1069 to let you know that Snowpark throws an error if parameter is a list.
Empfohlene Korrektur
There is not a recommended fix for this scenario because the tool always adds this EWI just in case the partitionBy parameter is a list. Remember that in Snowpark, only accepts cloud locations using a snowflake stage.
Szenario 2¶
Eingabecode:
In diesem Szenario ist der partitionBy-Parameter eine Liste.
Ausgabecode:
The tool adds the EWI SPRKPY1069 to let you know that Snowpark throws an error if parameter is a list.
Empfohlene Korrektur
If the value of the parameter is a list, then replace it with a ColumnOrSqlExpr.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1070¶
Message: The mode argument is transformed to overwrite, check the variable value and set the corresponding bool value.
Kategorie: Warnung
Beschreibung¶
Wenn es eine Verwendung von gibt:
The tool analyzes the parameter mode to determinate if the value is overwrite.
Szenarien¶
Szenario 1¶
Eingabecode
Für dieses Szenario erkennt das Tool, dass der mode-Parameter den entsprechenden boolschen Wert setzen kann.
Ausgabecode:
The SMA tool analyzes the mode parameter, determinate that the value is overwrite and set the corresponding bool value
Empfohlene Korrektur
Für dieses Szenario gibt es keine empfohlene Korrektur, da das Tool die entsprechende Transformation durchgeführt hat.
Szenario 2:
Eingabecode
In this scenario the tool can not validate the value is overwrite.
Ausgabecode:
Die SMA fügt eine EWI-Meldung hinzu, die darauf hinweist, dass der mode-Parameter in ‚overwrite‘ umgewandelt wurde. Sie soll Sie aber auch darauf hinweisen, dass es besser ist, den Variablenwert zu überprüfen und den richtigen boolschen Wert zu setzen.
Empfohlene Korrektur
Check for the value of the parameter mode and add the correct value for the parameter overwrite.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1071¶
Meldung: Die Funktion pyspark.rdd.RDD.getNumPartitions ist in Snowpark nicht erforderlich. Sie sollten also alle Referenzen entfernen.
Kategorie: Warnung
Beschreibung¶
This issue appears when the tool finds the use of the pyspark.rdd.RDD.getNumPartitions function. Snowflake uses micro-partitioning mechanism, so the use of this function is not required.
Szenario¶
Eingabe
Die getNumPartitions gibt die Anzahl der Partitionen auf einer RDD zurück.
Ausgabe
Das Tool fügt diese EWI hinzu, um Sie darauf hinzuweisen, dass getNumPartitions nicht erforderlich ist.
Empfohlene Korrektur
Entfernen Sie alle Verwendungen dieser Funktion.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1072¶
Meldung: Die Verwendung von StorageLevel ist in Snowpark nicht erforderlich.
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool finds the use of the StorageLevel class, which works like „flags“ to set the storage level. Since Snowflake controls the storage, the use of this function is not required.
Zusätzliche Empfehlungen¶
Entfernen Sie alle Verwendungen dieser Funktion.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1073¶
Meldung: pyspark.sql.functions.udf ohne Parameter oder Rückgabeparameter werden nicht unterstützt
Kategorie: Warnung.
Beschreibung¶
This issue appears when the tool detects the usage of pyspark.sql.functions.udf as function or decorator and is not supported in two specifics cases, when it has no parameters or return type parameter.
Szenarien¶
Szenario 1¶
Eingabe
In Pyspark können Sie eine benutzerdefinierte Funktion ohne Eingabe- oder Rückgabeparameter erstellen:
Ausgabe
Snowpark benötigt die Eingabe- und Rückgabetypen für die Udf-Funktion. Denn sie werden nicht bereitgestellt, und SMA kann diese Parameter nicht bereitstellen.
Empfohlene Korrektur
To fix this scenario is required to add the import for the returns types of the input and output, and then the parameters of return*type and input_types[] on the udf function _my_udf*.
Szenario 2¶
In PySpark können Sie einen @udf-Decorator ohne Parameter verwenden
Eingabe
Ausgabe
In Snowpark all the parameters of a udf decorator are required.
Empfohlene Korrektur
To fix this scenario is required to add the import for the returns types of the input and output, and then the parameters of return_type and input_types[] on the udf @udf decorator.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1074¶
Meldung: Datei hat gemischte Einrückung (Leerzeichen und Tabulatoren).
Kategorie: Parsing-Fehler.
Beschreibung¶
Dieses Problem tritt auf, wenn das Tool erkennt, dass die Datei eine gemischte Einrückung hat. Das bedeutet, dass die Datei eine Kombination aus Leerzeichen und Tabulatoren enthält, um Codezeilen einzurücken.
Szenario¶
Eingabe
In Pyspark können Sie Leerzeichen und Tabulatoren für die Identifikationsebene mischen.
Ausgabe
SMA kann nicht mit gemischten Einrückungsmarkierungen umgehen. Wenn dies in einer Python-Code-Datei erkannt wird, fügt SMA die EWI SPRKPY1074 in der ersten Zeile hinzu.
Empfohlene Korrektur
Die Lösung besteht darin, alle Einrückungssymbole anzugleichen.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1075¶
Kategorie
Warnung.
Beschreibung¶
Parse_json wendet keine Schema-Validierung an. Wenn Sie auf der Grundlage eines Schemas filtern/validieren möchten, müssen Sie möglicherweise eine Logik einführen.
Beispiel¶
Eingabe
Ausgabe
Bei der Funktion from_json wird das Schema nicht wirklich zur Inferenz übergeben, sondern zur Validierung verwendet. Siehe diese Beispiele:
Beispiel 1: Datentypen erzwingen und Spaltennamen ändern:
Beispiel 2: Bestimmte Spalten auswählen:
Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com. If you have a contract for support with Snowflake, reach out to your sales engineer and they can direct your support needs.
SPRKPY1076¶
Message: Parameters in pyspark.sql.readwriter.DataFrameReader methods are not supported. This applies to CSV, JSON and PARQUET methods.
Kategorie: Warnung.
Beschreibung¶
For the CSV, JSON and PARQUET methods on the pyspark.sql.readwriter.DataFrameReader object, the tool will analyze the parameters and add a transformation according to each case:
Alle Parameter entsprechen ihrem äquivalenten Namen in Snowpark: In diesem Fall wandelt das Tool den Parameter in einen .option()-Aufruf um. In diesem Fall fügt der Parameter diese EWI nicht hinzu.
Einige Parameter stimmen nicht mit der Äquivalenz in Snowpark überein: In diesem Fall fügt das Tool diese EWI mit den Parameterinformationen hinzu und entfernt sie aus dem Methodenaufruf.
Liste der Äquivalenzen:
Äquivalenzen für CSV:
Spark-Tasten |
Snowpark-Äquivalenzen |
|---|---|
sep |
FIELD_DELIMITER |
Header |
PARSE_HEADER |
lineSep |
RECORD_DELIMITER |
pathGlobFilter |
PATTERN |
Anführungszeichen |
FIELD_OPTIONALLY_ENCLOSED_BY |
nullValue |
NULL_IF |
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
inferSchema |
INFER_SCHEMA |
Trennzeichen |
FIELD_DELIMITER |
Äquivalenzen für JSON:
Spark-Tasten |
Snowpark-Äquivalenzen |
|---|---|
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
pathGlobFilter |
PATTERN |
Äquivalenzen für PARQUET:
Spark-Tasten |
Snowpark-Äquivalenzen |
|---|---|
pathGlobFilter |
PATTERN |
Szenarien¶
Szenario 1¶
Eingabe
Unter CVS finden Sie einige Beispiele:
Ausgabe
Im konvertierten Code werden die Parameter als einzelne Optionen zur cvs-Funktion hinzugefügt
Szenario 2¶
Eingabe
Unter JSON finden Sie einige Beispiele:
Ausgabe
Im konvertierten Code werden die Parameter als einzelne Optionen zur json-Funktion hinzugefügt
Szenario 3¶
Eingabe
Unter PARQUET finden Sie einige Beispiele:
Ausgabe
Im konvertierten Code werden die Parameter als individuelle Optionen zur Parkettfunktion hinzugefügt
Zusätzliche Empfehlungen¶
Wenn nicht-äquivalente Parameter vorhanden sind, empfiehlt es sich, die Verhaltensweise nach der Umwandlung zu überprüfen.
Auch die Dokumentation könnte nützlich sein, um eine bessere Lösung zu finden:
Options documentation for CSV: - PySpark CSV Options. - Snowpark CSV Options.
Options documentation for JSON: - PySpark JSON Options. - Snowpark JSON Options.
Options documentation for PARQUET: - Pyspark PARQUET options. - SnowPark PARQUET options..
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1077¶
Meldung: SQL eingebetteter Code kann nicht verarbeitet werden.
Kategorie: Warnung.
Beschreibung¶
Dieses Problem tritt auf, wenn das Tool einen SQL-eingebetteten Code erkennt, der nicht in Snowpark konvertiert werden kann.
Weitere Informationen finden Sie im Abschnitt „SQL-eingebetteter Code“.
Szenario¶
Eingabe
In diesem Beispiel ist der SQL-Code in eine Variable namens „Abfrage“ (query) eingebettet, die als Parameter für die Pyspark.sql-Methode verwendet wird.
Ausgabe
SMA erkennt, dass es sich bei dem Parameter PySpark.sql um eine Variable und nicht um einen SQL-Code handelt, so dass die Meldung EWI SPRKPY1077 zur Zeile PySpark.sql hinzugefügt wird.
Zusätzliche Empfehlungen¶
Für die Transformation von SQL muss dieser Code direkt als Parameter der Methode nur als Zeichenfolgewerte und ohne Interpolation enthalten sein. Bitte prüfen Sie die SQL, die an PySpark.SQL gesendet wird, um die Funktionalität auf Snowflake zu validieren.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1078¶
Meldung: Das Argument der Funktion pyspark.context.SparkContext.setLogLevel ist kein Literalwert und konnte daher nicht ausgewertet werden
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects the use of the pyspark.context.SparkContext.setLogLevel function with an argument that is not a literal value, for example, when the argument is a variable.
SMA führt eine statische Analyse Ihres Quellcodes durch. Daher ist es nicht möglich, den Inhalt dieses Arguments auszuwerten und eine Äquivalenz in Snowpark zu ermitteln.
Szenario¶
Eingabe
In diesem Beispiel wird der LogLevel in der Variablen my_log_level definiert und my_log_level als Parameter für die setLogLevel-Methode verwendet.
Ausgabe
SMA ist nicht in der Lage, das Argument für den Protokolliergrad-Parameter auszuwerten, daher wird die EWI SPRKPY1078 über der Zeile der transformierten Protokollierung hinzugefügt:
Empfohlene Korrektur
Even though the SMA was unable to evaluate the argument, it will transform the pyspark.context.SparkContext.setLogLevel function into the Snowpark equivalent. Please make sure the value of the level argument in the generated output code is a valid and equivalent log level in Snowpark according to the table below:
PySpark-Protokolliergrad |
Snowpark-Protokolliergrad äquivalent |
|---|---|
ALL |
Protokollieren.NOTSET |
DEBUG |
Protokollieren.DEBUG |
ERROR |
Protokollieren.ERROR |
FATAL |
Protokollieren.CRITICAL |
INFO |
Protokollieren.INFO |
OFF |
Protokollieren.WARNING |
TRACE |
Protokollieren.NOTSET |
WARN |
Protokollieren.WARNING |
Die empfohlene Lösung sieht also so aus:
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1079¶
Meldung: Das Argument der Funktion pyspark.context.SparkContext.setLogLevel ist kein gültiger PySpark-Protokolliergrad
Kategorie: Warnung
Beschreibung¶
This issue appears when the SMA detects the use of the pyspark.context.SparkContext.setLogLevel function with an argument that is not a valid log level in PySpark, and therefore an equivalent could not be determined in Snowpark.
Szenario¶
Eingabe
hier verwendet der Protokolliergrad „INVALID_LOG_LEVEL “, der kein gültiger Pyspark-Protokolliergrad ist.
Ausgabe
SMA den Protokolliergrad „INVALID_LOG_LEVEL“ nicht erkennen kann, obwohl SMA die Konvertierung vornimmt, wird EWI SPRKPY1079 hinzugefügt, um ein mögliches Problem anzuzeigen.
Empfohlene Korrektur
Make sure that the log level used in the pyspark.context.SparkContext.setLogLevel function is a valid log level in PySpark or in Snowpark and try again.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1081¶
This issue code has been deprecated since Spark Conversion Core 4.12.0
Meldung: pyspark.sql.readwriter.DataFrameWriter.partitionBy hat eine Problemumgehung.
Kategorie: Warnung
Beschreibung¶
The Pyspark.sql.readwriter.DataFrameWriter.partitionBy function is not supported. The workaround is to use Snowpark’s copy_into_location instead. See the documentation for more info.
Szenario¶
Eingabe
This code will create a separate directories for each unique value in the FIRST_NAME column. The data is the same, but it’s going to be stored in different directories based on the column.
This code will create a separate directories for each unique value in the FIRST_NAME column. The data is the same, but it’s going to be stored in different directories based on the column.
Ausgabecode
Empfohlene Korrektur
In Snowpark, copy_into_location has a partition_by parameter that you can use instead of the partitionBy function, but it’s going to require some manual adjustments, as shown in the following example:
Spark-Code:
Snowpark-Code manuell angepasst:
copy_into_location hat die folgenden Parameter
location: The Snowpark location only accepts cloud locations using an snowflake stage.
_partition_by_: Es kann ein Spaltenname oder ein SQL-Ausdruck sein. Sie müssen also in eine Spalte oder SQL konvertieren, indem Sie col oder sql_expr verwenden.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1082¶
Meldung: Die pyspark.sql.readwriter.DataFrameReader.load-Funktion wird nicht unterstützt. Eine Problemumgehung besteht darin, stattdessen die formatabhängige Snowpark DataFrameReader-Methode zu verwenden (avro csv, json, orc, parquet). Der Pfadparameter sollte ein Stagingbereich sein.
Kategorie: Warnung
Beschreibung¶
The pyspark.sql.readwriter.DataFrameReader.load function is not supported. The workaround is to use Snowpark DataFrameReader methods instead.
Szenarien¶
The spark signature for this method DataFrameReader.load(path, format, schema, **options) does not exist in Snowpark. Therefore, any usage of the load function is going to have an EWI in the output code.
Szenario 1¶
Eingabe
Below is an example that tries to load data from a CSV source.
Ausgabe
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use Snowpark DataFrameReader methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod withcsvmethod.The first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Below is an example that creates a temporal stage and puts the file into it, then calls the CSV method.
Fixing
schemaparameter:The schema can be set by using the schema function as follows:
Fixing
optionsparameter:
The options between spark and snowpark are not the same, in this case lineSep and dateFormat are replaced with RECORD_DELIMITER and DATE_FORMAT, the Additional recommendations section has a table with all the Equivalences.
Below is an example that creates a dictionary with RECORD_DELIMITER and DATE_FORMAT, and calls the options method with that dictionary.
Szenario 2¶
Eingabe
Below is an example that tries to load data from a JSON source.
Ausgabe
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use Snowpark DataFrameReader methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod withjsonmethodThe first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Below is an example that creates a temporal stage and puts the file into it, then calls the JSON method.
Fixing
schemaparameter:The schema can be set by using the schema function as follows:
Fixing
optionsparameter:
The options between Spark and snowpark are not the same, in this case dateFormat and timestampFormat are replaced with DATE_FORMAT and TIMESTAMP_FORMAT, the Additional recommendations section has a table with all the Equivalences.
Below is an example that creates a dictionary with DATE_FORMAT and TIMESTAMP_FORMAT, and calls the options method with that dictionary.
Szenario 3¶
Eingabe
Below is an example that tries to load data from a PARQUET source.
Ausgabe
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround, you can use Snowpark DataFrameReader methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod withparquetmethodThe first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Below is an example that creates a temporal stage and puts the file into it, then calls the PARQUET method.
Fixing
schemaparameter:The schema can be set by using the schema function as follows:
Fixing
optionsparameter:
The options between Spark and snowpark are not the same, in this case pathGlobFilter is replaced with PATTERN, the Additional recommendations section has a table with all the Equivalences.
Below is an example that creates a dictionary with PATTERN, and calls the options method with that dictionary.
Zusätzliche Empfehlungen¶
Berücksichtigen Sie, dass die Optionen zwischen Spark und Snowpark nicht die gleichen sind, aber sie können zugeordnet werden:
Spark-Optionen |
Möglicher Wert |
Snowpark-Äquivalent |
Beschreibung |
|---|---|---|---|
Header |
„True“ oder „False“ |
SKIP_HEADER = 1 / SKIP_HEADER = 0 |
Um die erste Zeile einer Datei als Spaltennamen zu verwenden. |
Trennzeichen |
Beliebiges ein-/mehrstelliges Feldtrennzeichen |
FIELD_DELIMITER |
Um einzelne/mehrere Zeichen als Trennzeichen für jede Spalte/jedes Feld festzulegen. |
sep |
Ein beliebiges einstelliges Feldtrennzeichen |
FIELD_DELIMITER |
Um ein einzelnes Zeichen als Trennzeichen für jede Spalte/jedes Feld anzugeben. |
Codierung |
UTF-8, UTF-16 usw… |
ENCODING |
Zum Decodieren der CSV-Dateien nach dem angegebenen Codierungstyp. Die Standardcodierung ist UTF-8 |
lineSep |
Ein beliebiges einzelnes Zeilentrennzeichen |
RECORD_DELIMITER |
Um das Zeilentrennzeichen zu definieren, das für das Parsen von Dateien verwendet werden soll. |
pathGlobFilter |
Dateimuster |
PATTERN |
So definieren Sie ein Muster, um nur Dateien zu lesen, deren Dateinamen dem Muster entsprechen. |
recursiveFileLookup |
„True“ oder „False“ |
N/A |
Zum rekursiven Durchsuchen eines Verzeichnisses, um Dateien zu lesen. Der Standardwert für diese Option ist „False“. |
Anführungszeichen |
Einzelnes Zeichen, das in Anführungszeichen gesetzt werden soll |
FIELD_OPTIONALLY_ENCLOSED_BY |
Um Felder/Spalte, die Felder enthalten, in Anführungszeichen zu setzen, und das Trennzeichen dabei Teil des Wertes sein kann. Dieses Zeichen „To quote all fields“, wenn es mit quoteAll-Option verwendet wird. Der Standardwert dieser Option ist das doppelte Anführungszeichen(„). |
nullValue |
Zeichenfolge zum Ersetzen von „null“ |
NULL_IF |
Ersetzen von Nullwerten durch die Zeichenfolge beim Lesen und Schreiben von Datenframe. |
dateFormat |
Gültiges Datumsformat |
DATE_FORMAT |
Um eine Zeichenfolge zu definieren, die ein Datumsformat angibt. Das Standardformat ist jjjj-MM-tt. |
timestampFormat |
Gültiges Format des Zeitstempels |
TIMESTAMP_FORMAT |
Zur Definition einer Zeichenfolge, die ein Zeitstempelformat angibt. Das Standardformat ist jjjj-MM-tt ‚T’HH: mm:ss. |
Escape-Zeichen |
Jedes einzelne Zeichen |
ESCAPE |
So legen Sie ein einzelnes Zeichen als Escape-Zeichen fest, um das Standard-Escape-Zeichen (\) zu überschreiben. |
inferSchema |
„True“ oder „False“ |
INFER_SCHEMA |
Erkennt automatisch das Dateischema |
mergeSchema |
„True“ oder „False“ |
N/A |
Wird in Snowflake nicht benötigt, da dies immer dann geschieht, wenn das infer_schema die Parquet-Dateistruktur bestimmt |
For modifiedBefore / modifiedAfter option you can achieve the same result in Snowflake by using the metadata columns and then adding a filter like:
df.filter(METADATA_FILE_LAST_MODIFIED > ‘some_date’).For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1083¶
Meldung: Die pyspark.sql.readwriter.DataFrameWriter.save-Funktion wird nicht unterstützt. Eine Problemumgehung besteht darin, stattdessen die Snowpark DataFrameWriter copy_into_location-Methode zu verwenden.
Kategorie: Warnung
Beschreibung¶
The pyspark.sql.readwriter.DataFrameWriter.save function is not supported. The workaround is to use Snowpark DataFrameWriter methods instead.
Szenarien¶
The spark signature for this method DataFrameWriter.save(path, format, mode, partitionBy, **options) does not exists in Snowpark. Therefore, any usage of the load function it’s going to have an EWI in the output code.
Szenario 1¶
Eingabecode
Below is an example that tries to save data with CSV format.
Ausgabecode
The tool adds this EWI SPRKPY1083 on the output code to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround you can use Snowpark DataFrameWriter methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod with csv or copy_into_location method.If you are using
copy_into_locationmethod, you need to specify the format with thefile_format_type parameter.The first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Nachfolgend finden Sie ein Beispiel, in dem ein zeitlicher Stagingbereich erstellt und die Datei darin abgelegt wird. Anschließend wird eine der oben genannten Methoden aufgerufen.
Fixing
modeparameter:Use the mode function from Snowpark DataFrameWriter, as follows:
Below is an example that adds into the daisy chain the mode method with overwrite as a parameter.
Fixing
partitionByparameter:Use the partition_by parameter from the
CSVmethod, as follows:
Below is an example that used the partition_by parameter from the CSV method.
Fixing
optionsparameter:Use the format_type_options parameter from the
CSVmethod, as follows:
The options between spark and snowpark are not the same, in this case lineSep and dateFormat are replaced with RECORD_DELIMITER and DATE_FORMAT, the Additional recommendations section has table with all the Equivalences.
Below is an example that creates a dictionary with RECORD_DELIMITER and DATE_FORMAT, and calls the options method with that dictionary.
Szenario 2¶
Eingabecode
Below is an example that tries to save data with JSON format.
Ausgabecode
The tool adds this EWI SPRKPY1083 on the output code to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround you can use Snowpark DataFrameReader methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod with json or copy_into_location methodIf you are using
copy_into_locationmethod, you need to specify the format with thefile_format_type parameter.The first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Nachfolgend finden Sie ein Beispiel, in dem ein zeitlicher Stagingbereich erstellt und die Datei darin abgelegt wird. Anschließend wird eine der oben genannten Methoden aufgerufen.
Fixing
modeparameter:Use the mode function from Snowpark DataFrameWriter, as follows:
Below is an example that adds into the daisy chain the mode method with overwrite as a parameter.
Fixing
partitionByparameter:Use the partition_by parameter from the
CSVmethod, as follows:
Below is an example that used the partition_by parameter from the CSV method.
Fixing
optionsparameter:Use the format_type_options parameter from the
CSVmethod, as follows:
The options between spark and snowpark are not the same, in this case dateFormat and timestampFormat are replaced with DATE_FORMAT and TIMESTAMP_FORMAT, the Additional recommendations section has table with all the Equivalences.
Below is an example that creates a dictionary with DATE_FORMAT and TIMESTAMP_FORMAT, and calls the options method with that dictionary.
Szenario 3¶
Eingabecode
Below is an example that tries to save data with PARQUET format.
Ausgabecode
The tool adds this EWI SPRKPY1083 on the output code to let you know that this function is not supported by Snowpark, but it has a workaround.
Empfohlene Korrektur
As a workaround you can use Snowpark DataFrameReader methods instead.
Fixing
pathandformatparameters:Replace the
loadmethod with parquet or copy_into_location method.If you are using
copy_into_locationmethod, you need to specify the format with thefile_format_type parameter.The first parameter
pathmust be in a stage to make an equivalence with Snowpark.
Nachfolgend finden Sie ein Beispiel, in dem ein zeitlicher Stagingbereich erstellt und die Datei darin abgelegt wird. Anschließend wird eine der oben genannten Methoden aufgerufen.
Fixing
modeparameter:Use the mode function from Snowpark DataFrameWriter, as follows:
Below is an example that adds into the daisy chain the mode method with overwrite as a parameter.
Fixing
partitionByparameter:Use the partition_by parameter from the
CSVmethod, as follows:
Below is an example that used the partition_by parameter from the parquet method.
Fixing
optionsparameter:Use the format_type_options parameter from the
CSVmethod, as follows:
The options between spark and snowpark are not the same, in this case pathGlobFilter is replaced with PATTERN, the Additional recommendations section has table with all the Equivalences.
Below is an example that creates a dictionary with PATTERN, and calls the options method with that dictionary.
Zusätzliche Empfehlungen¶
Beachten Sie, dass die Optionen zwischen Spark und Snowpark nicht die gleichen sind, aber sie können zugeordnet werden:
Spark-Optionen |
Möglicher Wert |
Snowpark-Äquivalent |
Beschreibung |
|---|---|---|---|
Header |
„True“ oder „False“ |
SKIP_HEADER = 1 / SKIP_HEADER = 0 |
Um die erste Zeile einer Datei als Spaltennamen zu verwenden. |
Trennzeichen |
Beliebiges ein-/mehrstelliges Feldtrennzeichen |
FIELD_DELIMITER |
Um einzelne/mehrere Zeichen als Trennzeichen für jede Spalte/jedes Feld festzulegen. |
sep |
Ein beliebiges einstelliges Feldtrennzeichen |
FIELD_DELIMITER |
Um ein einzelnes Zeichen als Trennzeichen für jede Spalte/jedes Feld anzugeben. |
Codierung |
UTF-8, UTF-16 usw… |
ENCODING |
Zum Decodieren der CSV-Dateien nach dem angegebenen Codierungstyp. Die Standardcodierung ist UTF-8 |
lineSep |
Ein beliebiges einzelnes Zeilentrennzeichen |
RECORD_DELIMITER |
Um das Zeilentrennzeichen zu definieren, das für das Parsen von Dateien verwendet werden soll. |
pathGlobFilter |
Dateimuster |
PATTERN |
So definieren Sie ein Muster, um nur Dateien zu lesen, deren Dateinamen dem Muster entsprechen. |
recursiveFileLookup |
„True“ oder „False“ |
N/A |
Zum rekursiven Durchsuchen eines Verzeichnisses, um Dateien zu lesen. Der Standardwert für diese Option ist „False“. |
Anführungszeichen |
Einzelnes Zeichen, das in Anführungszeichen gesetzt werden soll |
FIELD_OPTIONALLY_ENCLOSED_BY |
Um Felder/Spalte, die Felder enthalten, in Anführungszeichen zu setzen, und das Trennzeichen dabei Teil des Wertes sein kann. Dieses Zeichen „To quote all fields“, wenn es mit quoteAll-Option verwendet wird. Der Standardwert dieser Option ist das doppelte Anführungszeichen(„). |
nullValue |
Zeichenfolge zum Ersetzen von „null“ |
NULL_IF |
Ersetzen von Nullwerten durch die Zeichenfolge beim Lesen und Schreiben von Datenframe. |
dateFormat |
Gültiges Datumsformat |
DATE_FORMAT |
Um eine Zeichenfolge zu definieren, die ein Datumsformat angibt. Das Standardformat ist jjjj-MM-tt. |
timestampFormat |
Gültiges Format des Zeitstempels |
TIMESTAMP_FORMAT |
Zur Definition einer Zeichenfolge, die ein Zeitstempelformat angibt. Das Standardformat ist jjjj-MM-tt ‚T’HH: mm:ss. |
Escape-Zeichen |
Jedes einzelne Zeichen |
ESCAPE |
So legen Sie ein einzelnes Zeichen als Escape-Zeichen fest, um das Standard-Escape-Zeichen (\) zu überschreiben. |
inferSchema |
„True“ oder „False“ |
INFER_SCHEMA |
Erkennt automatisch das Dateischema |
mergeSchema |
„True“ oder „False“ |
N/A |
Wird in Snowflake nicht benötigt, da dies immer dann geschieht, wenn das infer_schema die Parquet-Dateistruktur bestimmt |
For modifiedBefore / modifiedAfter option you can achieve the same result in Snowflake by using the metadata columns and then add a filter like:
df.filter(METADATA_FILE_LAST_MODIFIED > ‘some_date’).For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1084¶
This issue code has been deprecated since Spark Conversion Core 4.12.0
Meldung: pyspark.sql.readwriter.DataFrameWriter.option wird nicht unterstützt.
Kategorie: Warnung
Beschreibung¶
The pyspark.sql.readwriter.DataFrameWriter.option function is not supported.
Szenario¶
Eingabecode
Below is an example using the option method, this method is used to add additional configurations when writing the data of a DataFrame.
Ausgabecode
The tool adds this EWI SPRKPY1084 on the output code to let you know that this function is not supported by Snowpark.
Empfohlene Korrektur
Für die pyspark.sql.readwriter.DataFrameWriter.option-Methode gibt es keine empfohlene Lösung.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1085¶
Meldung: pyspark.ml.feature.VectorAssembler wird nicht unterstützt.
Kategorie: Warnung
Beschreibung¶
The pyspark.ml.feature.VectorAssembler is not supported.
Szenario¶
Eingabecode
VectorAssembler wird verwendet, um mehrere Spalten zu einem einzigen Vektor zusammenzufassen.
Ausgabecode
The tool adds this EWI SPRKPY1085 on the output code to let you know that this class is not supported by Snowpark.
Empfohlene Korrektur
Für das pyspark.ml.feature.VectorAssembler gibt es keine empfohlene Korrektur.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1086¶
Meldung: pyspark.ml.linalg.VectorUDT wird nicht unterstützt.
Kategorie: Warnung
Beschreibung¶
The pyspark.ml.linalg.VectorUDT is not supported.
Szenario¶
Eingabecode
VectorUDT ist ein Datentyp zur Darstellung von Vektorspalten in einem DataFrame.
Ausgabecode
The tool adds this EWI SPRKPY1086 on the output code to let you know that this function is not supported by Snowpark.
Empfohlene Korrektur
Für die pyspark.ml.linalg.VectorUDT gibt es keine empfohlene Lösung.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1087¶
Meldung: Die pyspark.sql.dataframe.DataFrame.writeTo-Funktion wird nicht unterstützt, aber es eine Problemumgehung gibt.
Kategorie: Warnung.
Beschreibung¶
The pyspark.sql.dataframe.DataFrame.writeTo function is not supported. The workaround is to use Snowpark DataFrameWriter SaveAsTable method instead.
Szenario¶
Eingabe
Below is an example of a use of the pyspark.sql.dataframe.DataFrame.writeTo function, the dataframe df is written into a table name Personal_info.
Ausgabe
The SMA adds the EWI SPRKPY1087 to the output code to let you know that this function is not supported, but has a workaround.
Empfohlene Korrektur
Die Problemumgehung besteht darin, stattdessen die Snowpark DataFrameWriter SaveAsTable-Methode zu verwenden.
Zusätzliche Empfehlungen¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1088¶
Meldung: Die Werte von pyspark.sql.readwriter.DataFrameWriter.option in Snowpark können unterschiedlich sein, so dass eine Validierung erforderlich sein könnte.
Kategorie: Warnung
Beschreibung¶
The pyspark.sql.readwriter.DataFrameWriter.option values in Snowpark may be different, so validation might be needed to ensure that the behavior is correct.
Szenarien¶
Es gibt einige Szenarien, je nachdem, ob die Option unterstützt wird oder nicht oder welches Format zum Schreiben der Datei verwendet wird.
Szenario 1¶
Eingabe
Below is an example of the usage of the method option, adding a sep option, which is currently supported.
Ausgabe
The tool adds the EWI SPRKPY1088 indicating that it is required validation.
Empfohlene Korrektur
Die Snowpark API unterstützt diesen Parameter, so dass die einzige Maßnahme darin bestehen kann, die Verhaltensweise nach der Migration zu überprüfen. Die unterstützten Parameter entnehmen Sie bitte der Äquivalenzen-Tabelle.
Szenario 2¶
Eingabe
Here the scenario shows the usage of option, but adds a header option, which is not supported.
Ausgabe
The tool adds the EWI SPRKPY1088 indicating that it is required validation is needed.
Empfohlene Korrektur
For this scenario it is recommended to evaluate the Snowpark format type options to see if it is possible to change it according to your needs. Also, check the behavior after the change.
Szenario 3¶
Eingabe
This scenario adds a sep option, which is supported and uses the JSON method.
Note: this scenario also applies for
PARQUET.
Ausgabe
The tool adds the EWI SPRKPY1088 indicating that it is required validation is needed.
Empfohlene Korrektur
The file format JSON does not support the parameter sep, so it is recommended to evaluate the snowpark format type options to see if it is possible to change it according to your needs. Also, check the behavior after the change.
Zusätzliche Empfehlungen¶
Since there are some
not supportedparameters, it is recommended to check thetable of equivalencesand check the behavior after the transformation.Äquivalenzen-Tabelle:
PySpark-Option |
SnowFlake-Option |
Unterstützte Dateiformate |
Beschreibung |
|---|---|---|---|
SEP |
FIELD_DELIMITER |
CSV |
Ein oder mehrere einzelne Byte- oder Multibyte-Zeichen, die Felder in einer Eingabedatei trennen. |
LINESEP |
RECORD_DELIMITER |
CSV |
Ein oder mehrere Zeichen, die Datensätze in einer Eingabedatei trennen. |
QUOTE |
FIELD_OPTIONALLY_ENCLOSED_BY |
CSV |
Zeichen, das verwendet wird, um Zeichenfolgen einzuschließen. |
NULLVALUE |
NULL_IF |
CSV |
Zeichenfolge, die zum Konvertieren in und von SQL NULL verwendet wird. |
DATEFORMAT |
DATE_FORMAT |
CSV |
Zeichenfolge, die das Format der Datumswerte in den zu ladenden Datendateien definiert. |
TIMESTAMPFORMAT |
TIMESTAMP_FORMAT |
CSV |
Zeichenfolge, die das Format der Zeitstempelwerte in den zu ladenden Datendateien definiert. |
Wenn der verwendete Parameter nicht in der Liste enthalten ist, gibt API einen Fehler aus.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1089¶
Meldung: Die Werte von pyspark.sql.readwriter.DataFrameWriter. options in Snowpark können unterschiedlich sein, so dass eine Validierung erforderlich sein könnte.
Kategorie: Warnung
Beschreibung¶
The pyspark.sql.readwriter.DataFrameWriter.options values in Snowpark may be different, so validation might be needed to ensure that the behavior is correct.
Szenarien¶
Es gibt einige Szenarien, je nachdem, ob die Optionen unterstützt werden oder nicht oder welches Format zum Schreiben der Datei verwendet wird.
Szenario 1¶
Eingabe
Below is an example of the usage of the method options, adding the options sep and nullValue, which are currently supported.
Ausgabe
The tool adds the EWI SPRKPY1089 indicating that it is required validation.
Empfohlene Korrektur
Snowpark API unterstützt diese Parameter, so dass die einzige Maßnahme darin bestehen kann, die Verhaltensweise nach der Migration zu überprüfen. Die unterstützten Parameter entnehmen Sie bitte der Äquivalenzen-Tabelle.
Szenario 2¶
Eingabe
Here the scenario shows the usage of options, but adds a header option, which is not supported.
Ausgabe
The tool adds the EWI SPRKPY1089 indicating that it is required validation is needed.
Empfohlene Korrektur
For this scenario it is recommended to evaluate the Snowpark format type options to see if it is possible to change it according to your needs. Also, check the behavior after the change.
Szenario 3¶
Eingabe
This scenario adds a sep option, which is supported and uses the JSON method.
Ausgabe
The tool adds the EWI SPRKPY1089 indicating that it is required validation is needed.
Note: this scenario also applies for
PARQUET.
Empfohlene Korrektur
The file format JSON does not support the parameter sep, so it is recommended to evaluate the snowpark format type options to see if it is possible to change it according to your needs. Also, check the behavior after the change.
Zusätzliche Empfehlungen¶
Since there are some
not supportedparameters, it is recommended to check thetable of equivalencesand check the behavior after the transformation.Äquivalenzen-Tabelle:
Snowpark kann eine Liste von Äquivalenzen für einige Parameter unterstützen:
PySpark-Option |
SnowFlake-Option |
Unterstützte Dateiformate |
Beschreibung |
|---|---|---|---|
SEP |
FIELD_DELIMITER |
CSV |
Ein oder mehrere einzelne Byte- oder Multibyte-Zeichen, die Felder in einer Eingabedatei trennen. |
LINESEP |
RECORD_DELIMITER |
CSV |
Ein oder mehrere Zeichen, die Datensätze in einer Eingabedatei trennen. |
QUOTE |
FIELD_OPTIONALLY_ENCLOSED_BY |
CSV |
Zeichen, das verwendet wird, um Zeichenfolgen einzuschließen. |
NULLVALUE |
NULL_IF |
CSV |
Zeichenfolge, die zum Konvertieren in und von SQL NULL verwendet wird. |
DATEFORMAT |
DATE_FORMAT |
CSV |
Zeichenfolge, die das Format der Datumswerte in den zu ladenden Datendateien definiert. |
TIMESTAMPFORMAT |
TIMESTAMP_FORMAT |
CSV |
Zeichenfolge, die das Format der Zeitstempelwerte in den zu ladenden Datendateien definiert. |
Wenn der verwendete Parameter nicht in der Liste enthalten ist, gibt API einen Fehler aus.
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1101¶
Kategorie¶
Parsing-Fehler.
Beschreibung¶
Wenn das Tool einen Parsing-Fehler erkennt, versucht es, ihn zu beheben und setzt den Prozess in der nächsten Zeile fort. In diesen Fällen werden der Fehler und die Kommentare in der Zeile angezeigt.
Dieses Beispiel zeigt, wie ein Fehler bei der Abweichung zwischen Leerzeichen und Tabulatoren behandelt wird.
Eingabecode
Ausgabecode
Empfehlungen¶
Versuchen Sie, die kommentierte Zeile zu korrigieren.
For more support, email us at sma-support@snowflake.com. If you have a support contract with Snowflake, reach out to your sales engineer, who can direct your support needs.