Snowpark Migration Accelerator:Python用問題コード¶
SPRKPY1000¶
メッセージ:Source project spark-core version is xx.xx:xx.x.x, the spark-core version supported by snowpark is 2.12:3.1.2 so there may be functional differences between the existing mappings.
カテゴリ: 警告。
説明¶
この問題は、ソースコードのPysparkバージョンがサポートされていない場合に発生します。これは、既存のマッピングの間に機能差がある可能性があることを意味します。
その他の推奨事項¶
Snowparkとの互換性のために SMA によってスキャンされたpysparkのバージョンは2.12から3.1.2です。この範囲外のバージョンを使用している場合、ツールは一貫性のない結果を出す可能性があります。スキャンするソースコードのバージョンを変更することができます。
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.
説明¶
解析エラーは、Snowpark Migration Accelerator(SMA)がファイル内のコードを正しく読み取れなかったり、理解できなかったりした場合に報告されます(ファイルを正しく「解析」できませんでした)。この問題コードは、ファイルに1つ以上の解析エラーがある場合に表示されます。
シナリオ¶
入力: EWI のメッセージは、コードが無効な構文を持つ場合に表示されます。
出力: SMA は、解析エラーを見つけ、対応する EWI メッセージを解析エラーに追加してコメントします。
その他の推奨事項¶
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.
説明¶
このエラーは、Snowparkでサポートされておらず、独自のエラーコードが関連付けられていない要素の使用をツールが検出した場合に表示されます。これは、サポートされていない要素に対して SMA が使用する一般的なエラーコードです。
その他の推奨事項¶
メッセージ上のオプションや要素がサポートされていなくても、解決策が見つからないわけではありません。ツール自体が解決策を見つけられないというだけのことです。
pyspark.mlライブラリのサポートされていない要素に遭遇した場合は、代替の方法を検討します。Snowflakeのこのガイドのような、mlに関連する問題のウォークスルーに利用可能な追加のガイドがあります。
ソースコードの構文が正しいか確認します。(issues.csvファイルを使用して、変換エラーの発生箇所を特定することができます。)構文が正しければ、 SMA の問題を報告するオプションを使用して、特定の要素で変換エラーが発生したことを報告します。この問題を報告する際に、エラーの原因となったコード行を説明文に含めます。
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.
説明¶
この問題は、記号テーブルの記号処理にエラーがある場合に発生します。記号テーブルは、 SMA の基になるアーキテクチャの一部であり、より複雑な変換を可能にします。このエラーは、ソースコード内の予期せぬステートメントが原因である可能性があります。
その他の推奨事項¶
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.
説明¶
この問題は、ツールの実行プロセスで予期せぬエラーが発生した場合に表示されます。記号テーブルがロードできないため、ツールは評価または変換プロセスを開始できません。
その他の推奨事項¶
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¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.conf.SparkConf is not required
Category**:** Warning.
説明¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf which is not required.
シナリオ¶
入力
SparkConf はパラメーターなし、またはloadDefaultsとともに呼び出すことができます。
出力
For both cases (with or without parameters) SMA creates a Snowpark Session.builder object:
その他の推奨事項¶
これは不要なパラメーターが削除され、警告コメントが挿入されたものです。ユーザーからの追加アクションは必要ありません。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1006¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.context.SparkContext is not required
Category**:** Warning.
説明¶
This issue appears when the tool detects the usage of pyspark.context.SparkContext, which is not required in Snowflake.
シナリオ¶
入力
この例では、Sparkクラスターへの接続を作成するために2つのコンテキストがあります。
出力
Snowflakeにはクラスターが存在しないため、コンテキストは必要ありません。そのため、Sparkのプロパティを含む変数my_sc1とmy_sc2は不要か、コードを修正する必要があることに注意してください。
その他の推奨事項¶
これは不要なパラメーターが削除され、警告コメントが挿入されたものです。ユーザーからのアクションはありません。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1007¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
Message**:** pyspark.sql.context.SQLContext is not required
Category**:** Warning.
説明¶
This issue appears when the tool detects the usage of pyspark.sql.context.SQLContext, which is not required.
シナリオ¶
入力
ここでは、 SparkContext のオーバーロードを変更した例を示します。
出力
出力コードでは、pyspark.SQLContext の行がコメントされ、シナリオが構成への参照に置き換えられています。Sparkのプロパティを含んでいる変数my_sc1とmy_sc2は、不要な場合やコードを修正するために変更される場合があります。
その他の推奨事項¶
これは不要なパラメーターであるため、ソースコードに警告コメントを挿入して削除します。ユーザーからのアクションはありません。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1008¶
メッセージ: pyspark.sql.context.HiveContext is not required
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.context.HiveContext, which is not required.
シナリオ¶
入力
この例では、Hiveストアへの接続を作成する例を示します。
出力
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
推奨される修正
For the output code in the example you should add the Snow Park Session Object similar to this code:
その他の推奨事項¶
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.
説明¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrame.approxQuantile which has a workaround.
シナリオ¶
入力
It's important understand that Pyspark uses two different approxQuantile functions, here we use the DataFrame approxQuantile version
出力
SMA は、approxQuantileが使用された行に EWI SPRKPY1009 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
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:
SnowPark には、 DataFrame.approxQuantileのrelativeErrorパラメーターが存在しません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1010¶
メッセージ: pyspark.sql.dataframe.DataFrame.checkpoint has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrame.checkpoint which has a workaround.
シナリオ¶
入力
PySpark では、チェックポイントは、データフレームの論理計画を切り捨てるために使用されます。これは、理論プランの拡大を回避するためです。
出力
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.
推奨される修正
Snowparkは明示的なチェックポイントを不要にします。Snowparkは、Snowflakeクエリ最適化エンジンによって最適化された SQL に基づく操作で動作するため、一方的な計算や制御不能になる論理プランが不要になるからです。
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.
永続的なテーブルや計算結果を使用することで、セッション終了後でもいつでもアクセスすることができます。
別の方法として、仮テーブルを使用すると、セッション終了後にテーブルが削除されるという利点があります。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1011¶
メッセージ: pyspark.sql.dataframe.DataFrameStatFunctions.approxQuantile has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrameStatFunctions.approxQuantile which has a workaround.
シナリオ¶
入力
It's important understand that Pyspark uses two different approxQuantile functions, here we use the DataFrameStatFunctions approxQuantile version.
出力
SMA は、approxQuantileが使用された行に EWI SPRKPY1011 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
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:
SnowPark には、 DataFrame.approxQuantileのrelativeErrorパラメーターが存在しません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1012¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.dataframe.DataFrameStatFunctions.writeTo has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.dataframe.DataFrameStatFunctions.writeTo which has a workaround.
シナリオ¶
入力
この例では、dataframe dfはSparkテーブルの「table」に書き込まれます。
出力
SMA は、 DataFrameStatFunctions.writeToが使用された行に EWI SPRKPY1012 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
代わりに、df.write.SaveAsTable()を使用します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1013¶
メッセージ: pyspark.sql.functions.acosh has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.acosh which has a workaround.
シナリオ¶
入力
On this example pyspark calculates the acosh for a dataframe by using pyspark.sql.functions.acosh
出力
SMA は、acoshが使用された行に EWI SPRKPY1013 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1014¶
メッセージ: pyspark.sql.functions.asinh has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.asinh which has a workaround.
シナリオ¶
入力
On this example pyspark calculates the asinh for a dataframe by using pyspark.sql.functions.asinh.
出力
SMA はasinhが使われている行に EWI SPRKPY1014 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1015¶
メッセージ: pyspark.sql.functions.atanh has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.atanh which has a workaround.
シナリオ¶
入力
On this example pyspark calculates the atanh for a dataframe by using pyspark.sql.functions.atanh.
出力
SMA は、atanhが使用された行に EWI SPRKPY1015 を返すため、修正が必要な箇所を識別するのに使用できます。
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1016¶
警告
This issue code has been deprecated since Spark Conversion Core Version 0.11.7
メッセージ: pyspark.sql.functions.collect_set has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.collect_set which has a workaround.
シナリオ¶
入力
Using collect*set to get the elements of _colname* without duplicates:
出力
SMA は、collect_setが使用された行に EWI SPRKPY1016 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
array_agg関数を使用し、値Trueの第2引数を追加します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1017¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
pyspark.sql.functions.date_addには回避策があります。
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.date_add which has a workaround.
シナリオ¶
入力
この例では、date_addを使用して、dataframe dfの現在の日付から5日後の日付を計算しています。
出力
SMA は、date_addが使用された行に EWI SPRKPY1017 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
Import snowflake.snowpark.functions, which contains an implementation for date_add (and alias dateAdd) function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1018¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
メッセージ: pyspark.sql.functions.date_sub has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.date_sub which has a workaround.
シナリオ¶
入力
この例では、date_addを使用して、dataframe dfのために現在の日付から5日前の日付を計算しています。
出力
SMA は、date_subが使用された行に EWI SPRKPY1018 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
Import snowflake.snowpark.functions, which contains an implementation for date_sub function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1019¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.8.0
メッセージ: pyspark.sql.functions.datediff has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.datediff which has a workaround.
シナリオ¶
入力
この例では、「today」と他の日付の差分を計算するためにdatediffを使用しています。
出力
SMA は、datediffが使用された行に EWI SPRKPY1019 を返すため、修正箇所を識別するのに使用できます。
SMA convert pyspark.sql.functions.datediff onto snowflake.snowpark.functions.daydiff that also calculates the diference in days between two dates.
推奨される修正
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.
推奨¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1020¶
メッセージ: pyspark.sql.functions.instr has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.instr which has a workaround.
シナリオ¶
入力
pyspark instrの基本的な使用例は以下のとおりです。
出力:
SMA はinstrが使われている行に EWI SPRKPY1020 を返すため、修正箇所を識別するのに使用できます。
推奨される修正
Requires a manual change by using the function charindex and changing the order of the first two parameters.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1021¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.last has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.last function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
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.
その他の推奨事項¶
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¶
メッセージ: pyspark.sql.functions.log10 has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log10 function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can use the snowflake.snowpark.functions.log function by passing the literal value 10 as the base.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1023¶
メッセージ: pyspark.sql.functions.log1p has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log1p function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1024¶
メッセージ: pyspark.sql.functions.log2 has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.log2 function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can use the snowflake.snowpark.functions.log function by passing the literal value 2 as the base.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1025¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.ntile has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.ntile function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1026¶
警告
This issue code has been deprecated since Spark Conversion Core 4.3.2
メッセージ: pyspark.sql.readwriter.DataFrameReader.csv has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.csv function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
In this section, we explain how to configure the path parameter, the schema parameter and some options to make them work in Snowpark.
1. パスパラメーター
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. スキーマパラメーター
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. オプションパラメーター
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.
注釈
以下のオプションはSnowparkでは サポートされていません。
columnNameOfCorruptRecord
emptyValue
enforceSchema
header
ignoreLeadingWhiteSpace
ignoreTrailingWhiteSpace
inferSchema
locale
maxCharsPerColumn
maxColumns
mode
multiLine
nanValue
negativeInf
nullValue
positiveInf
quoteAll
samplingRatio
timestampNTZFormat
unescapedQuoteHandling
以下は、Snowparkで動作するように上記の提案を適用した後の入力コードの全体的な例です。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1027¶
警告
This issue code has been deprecated since Spark Conversion Core 4.5.2
メッセージ: pyspark.sql.readwriter.DataFrameReader.json has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.json function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
In this section, we explain how to configure the path parameter, the schema parameter and some options to make them work in Snowpark.
1. パスパラメーター
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. スキーマパラメーター
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. オプションパラメーター
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.
注釈
以下のオプションはSnowparkではサポートされていません。
allowBackslashEscapingAnyCharacter
allowComments
allowNonNumericNumbers
allowNumericLeadingZero
allowSingleQuotes
allowUnquotedControlChars
allowUnquotedFieldNames
columnNameOfCorruptRecord
dropFiledIfAllNull
encoding
ignoreNullFields
lineSep
locale
mode
multiline
prefersDecimal
primitiveAsString
samplingRatio
timestampNTZFormat
timeZone
以下は、Snowparkで動作するように上記の提案を適用した後の入力コードの全体的な例です。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1028¶
メッセージ: pyspark.sql.readwriter.DataFrameReader.orc has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.readwriter.DataFrameReader.orc function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
In this section, we explain how to configure the path parameter and the extra options to make them work in Snowpark.
1. パスパラメーター
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. オプションパラメーター
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.
注釈
以下のオプションはSnowparkではサポートされていません。
compression
mergeSchema
以下は、Snowparkで動作するように上記の提案を適用した後の入力コードの全体的な例です。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1029¶
メッセージ:This issue appears when the tool detects the usage of pyspark.sql.readwriter.DataFrameReader.parquet.この関数はサポートされていますが、SnowparkとSpark API の違いによっては、手動での変更が必要になる場合があります。
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.parquet function that generates this EWI.
出力
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.
推奨される修正
In this section, we explain how to configure the paths and options parameters to make them work in Snowpark.
1. パスパラメーター
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. オプションパラメーター
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.
Snowpark options と PySpark options は完全には同じではないため、手動で変更することが必要になる場合があります。以下は、Snowparkで最も一般的な PySpark オプションの構成方法の詳細です。
2.1 mergeSchemaオプション
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 オプション
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 オプション
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オプション
You can achieve the same result in Snowflake by using the metadata columns.
注釈
以下のオプションはSnowparkではサポートされていません。
compression
datetimeRebaseMode
int96RebaseMode
mergeSchema
以下は、Snowparkで動作させるために入力コードをどのように変換すべきかの包括的な例です。
その他の推奨事項¶
Snowflakeでは、parquetデータの取り込みに次のような他のアプローチを活用できます。
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.
移行の際には、 SMA のレポートを活用してファイルのインベントリを作成し、モダナイゼーション後にどのステージ/テーブルにデータがマッピングされるかを決定するのが良い方法です。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1030¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.session.SparkSession.Builder.appName has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.session.SparkSession.Builder.appName function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can import the snowpark_extensions package which provides an extension for the appName function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1031¶
警告
This issue code has been deprecated since Spark Conversion Core 2.7.0
メッセージ: pyspark.sql.column.Column.contains has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.contains function, which has a workaround.
シナリオ¶
入力
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'.
出力
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.
推奨される修正
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.
その他の推奨事項¶
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
カテゴリ: 変換エラー
説明¶
この問題は、指定された要素に対して適切なマッピングステータスを SMA が決定できなかった場合に発生します。これは、この要素がSnowparkでサポートされているかどうかを SMA がまだ知らないことを意味します。これは、定義されていない要素に対して SMA が使用する一般的なエラーコードです。
シナリオ¶
入力
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.
出力
The SMA adds the EWI SPRKPY1032 to the output code to let you know that this element is not defined.
推奨される修正
問題の識別を試みるために、以下を検証します。
ソースコードの構文が正しいか、スペルが正しいかを確認します。
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1033¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.asc has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.asc function, which has a workaround.
シナリオ¶
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.
シナリオ1¶
入力
Below is an example of a use of the pyspark.sql.functions.asc function that takes a column object as parameter.
出力
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.
推奨される修正
As a workaround, you can call the snowflake.snowpark.Column.asc function from the column parameter.
シナリオ2¶
入力
Below is an example of a use of the pyspark.sql.functions.asc function that takes the name of the column as parameter.
出力
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.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1034¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.desc has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.desc function, which has a workaround.
シナリオ¶
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.
シナリオ1¶
入力
Below is an example of a use of the pyspark.sql.functions.desc function that takes a column object as parameter.
出力
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.
推奨される修正
As a workaround, you can call the snowflake.snowpark.Column.desc function from the column parameter.
シナリオ2¶
入力
Below is an example of a use of the pyspark.sql.functions.desc function that takes the name of the column as parameter.
出力
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.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1035¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.reverse has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.reverse function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can import the snowpark_extensions package which provides an extension for the reverse function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1036¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.column.Column.getField has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.getField function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can use the Snowpark column indexer operator with the name of the field as the index.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1037¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.sort_array has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.sort_array function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can import the snowpark_extensions package which provides an extension for the sort_array function.
その他の推奨事項¶
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
カテゴリ: 変換エラー
説明¶
この問題は、 SMA によって認識されなかった PySpark 要素がソースコードにある場合に発生します。これは、以下のようなさまざまな理由で起こる可能性があります。
PySpark に存在しない要素。
SMA がまだサポートしていない PySpark バージョンで追加された要素。
要素を処理する際の SMA の内部エラー。
これは、認識できない要素に対して SMA が使用する一般的なエラーコードです。
シナリオ¶
入力
以下は、 PySpark に存在しないため、 SMA で認識できなかった関数の使用例です。
出力
The SMA adds the EWI SPRKPY1038 to the output code to let you know that this element could not be recognized.
推奨される修正
問題の識別を試みるために、以下を検証します。
PySpark に要素が存在するかどうかを確認します。
要素のスペルが正しいかどうかを確認します。
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1039¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.column.Column.getItem has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.column.Column.getItem function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
回避策として、フィールドの名前または位置をインデックスとして Snowpark列インデクサー演算子 を使用することができます。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1040¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.functions.explode has a workaround, see documentation for more info
カテゴリ: 警告
説明¶
This issue appears when the SMA detects a use of the pyspark.sql.functions.explode function, which has a workaround.
シナリオ¶
入力
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.
出力
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.
推奨される修正
As a workaround, you can import the snowpark_extensions package which provides an extension for the explode function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1041¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.9.0
メッセージ: pyspark.sql.functions.explode_outer has a workaround
カテゴリ: 警告
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.explode_outer which has a workaround.
シナリオ¶
入力
この例では、 explode_outer というメソッドを選択呼出しで使用しています。
出力
The tool adds the EWI SPRKPY1041 indicating that a workaround can be implemented.
推奨される修正
As a workaround, you can import the snowpark_extensions package, which contains a helper for the explode_outer function.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1042¶
メッセージ: pyspark.sql.functions.posexplode has a workaround
カテゴリ: 警告
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.posexplode which has a workaround.
シナリオ¶
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).
シナリオ1¶
入力
Below is an example of the usage of posexplode passing as a parameter of a list of values.
出力
The tool adds the EWI SPRKPY1042 indicating that a workaround can be implemented.
推奨される修正
For having the same behavior, use the method functions.flatten, drop extra columns, and rename index and value column names.
シナリオ2¶
入力
Below is another example of the usage of posexplode passing as a parameter a map/dictionary (keys/values)
出力
The tool adds the EWI SPRKPY1042 indicating that a workaround can be implemented.
推奨される修正
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.
注意: row_numberを使用する場合は完全に等価ではありません。row_numberが1から始まるからです(Sparkメソッドのように0ではありません)。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1043¶
メッセージ: pyspark.sql.functions.posexplode_outer has a workaround
カテゴリ: 警告
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.posexplode_outer which has a workaround.
シナリオ¶
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).
シナリオ1¶
入力
Below is an example that shows the usage of posexplode_outer passing a list of values.
出力
The tool adds the EWI SPRKPY1043 indicating that a workaround can be implemented.
推奨される修正
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.
シナリオ2¶
入力
以下は、 マップ/ディクショナリ(キー/値) を渡すposexplode_outerの別の使用例です。
出力
The tool adds the EWI SPRKPY1043 indicating that a workaround can be implemented.
推奨される修正
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.
注意: row_numberを使用する場合は完全に等価ではありません。row_numberが1から始まるからです(Sparkメソッドのように0ではありません)。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1044¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
メッセージ: pyspark.sql.functions.split has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.split which has a workaround.
シナリオ¶
メソッドに渡されるパラメーターの量によって、いくつかのシナリオがあります。
シナリオ1¶
入力
Below is an example when the function split has just the str and pattern parameters
出力
The tool shows the EWI SPRKPY1044 indicating there is a workaround.
推奨される修正
As a workaround, you can call the function snowflake.snowpark.functions.lit with the pattern parameter and send it into the split.
シナリオ2¶
入力
Below is another example when the function split has the str, pattern, and limit parameters.
出力
The tool shows the EWI SPRKPY1044 indicating there is a workaround.
推奨される修正
このシナリオはサポートされていません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1045¶
メッセージ: pyspark.sql.functions.map_values has a workaround
カテゴリ: 警告。
説明¶
この関数は、 マップ/ディクショナリ9キー/値) を含む列から値のリストを抽出するために使用されます。
The issue appears when the tool detects the usage of pyspark.sql.functions.map_values which has a workaround.
シナリオ¶
入力
Below is an example of the usage of the method map_values.
出力
The tool adds the EWI SPRKPY1045 indicating that a workaround can be implemented.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1046¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.1.22
メッセージ: pyspark.sql.functions.monotonically_increasing_id has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.functions.monotonically_increasing_id which has a workaround.
シナリオ¶
入力
Below is an example of the usage of the method monotonically_increasing_id.
出力
The tool adds the EWI SPRKPY1046 indicating that a workaround can be implemented.
推奨される修正
ツールバージョンを更新します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1047¶
警告
This issue code has been deprecated since Spark Conversion Core Version 4.6.0
説明¶
This issue appears when the tool detects the usage of pyspark.context.SparkContext.setLogLevel which has a workaround.
シナリオ¶
入力
Below is an example of the usage of the method setLogLevel.
出力
The tool adds the EWI SPRKPY1047 indicating that a workaround can be implemented.
推奨される修正
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":
レベル等価表
レベルソースパラメーター |
レベルターゲットパラメーター |
|---|---|
"ALL" |
<mark style="color:red;">**This has no equivalent**</mark> |
"DEBUG" |
logging.DEBUG |
"ERROR" |
logging.ERROR |
"FATAL" |
logging.CRITICAL |
"INFO" |
logging.INFO |
"OFF" |
logging.NOTSET |
"TRACE" |
<mark style="color:red;">**This has no equivalent**</mark> |
"WARN" |
logging.WARNING |
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1048¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
メッセージ: pyspark.sql.session.SparkSession.conf has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.conf which has a workaround.
シナリオ¶
入力
Below is an example of how to set a configuration into the property conf .
出力
The tool adds the EWI SPRKPY1048 indicating that a workaround can be implemented.
推奨される修正
SparkSession.confはPysparkでのみ使用される特定の設定を渡すために使用され、Snowparkには適用されません。コードを削除したり、コメントしたりすることができます
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1049¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.1.9
メッセージ: pyspark.sql.session.SparkSession.sparkContext has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.sparkContext which has a workaround.
シナリオ¶
入力
Below is an example that creates a spark session and then uses the SparkContext property to print the appName.
出力
The tool adds the EWI SPRKPY1049 indicating that a workaround can be implemented.
推奨される修正
SparkContext は、 SnowPark ではサポートされていませんが、 SparkContext のメソッドやプロパティにセッションインスタンスから直接アクセスすることができます。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1050¶
メッセージ: pyspark.conf.SparkConf.set has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf.set which has a workaround.
シナリオ¶
入力
Below is an example that sets a variable using conf.set.
出力
The tool adds the EWI SPRKPY1050 indicating that a workaround can be implemented.
推奨される修正
SparkConf.setは、Pysparkでのみ使用される構成設定を設定するために使用され、Snowparkには適用されません。コードを削除したり、コメントしたりすることができます
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1051¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.4.0
メッセージ: pyspark.sql.session.SparkSession.Builder.master has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects pyspark.sql.session.SparkSession.Builder.master usage which has a workaround.
シナリオ¶
入力
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.
出力
The tool adds the EWI SPRKPY1051 indicating that a workaround can be implemented.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1052¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.8.0
メッセージ: pyspark.sql.session.SparkSession.Builder.enableHiveSupport has a workaround
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.sql.session.SparkSession.Builder.enableHiveSupport which has a workaround.
シナリオ¶
入力
Below is an example that configures the SparkSession and enables the hive support using the method enableHiveSupport.
出力
The tool adds the EWI SPRKPY1052 indicating that a workaround can be implemented.
推奨される修正
Remove the use of enableHiveSupport function because it is not needed in Snowpark.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1053¶
メッセージ:An error occurred when extracting the dbc files.
カテゴリ: 警告。
説明¶
この問題は、dbcファイルを抽出できない場合に発生します。この警告は、重すぎる、アクセスできない、読み取り専用などのような原因が考えられます。
その他の推奨事項¶
回避策として、ファイルが重すぎて処理できない場合は、ファイルのサイズを確認することができます。また、アクセスの問題を避けるために、ツールがアクセスできるかどうかを分析します。
サポートの詳細については、 snowconvert-info@snowflake.com にメールでお問い合わせください。Snowflakeとサポート契約を結んでいる場合は、セールスエンジニアにご連絡ください。必要なサポートにご案内します。
SPRKPY1080¶
メッセージ:The value of SparkContext is replaced with 'session' variable.
カテゴリ: 警告
説明¶
SparkのコンテキストはSnowparkセッションを作成するsessionという変数に格納されます。
シナリオ¶
入力
このスニペットは SparkContext を説明します
出力
この出力コードでは、 SMA は、 PySpark.SparkContext を SparkSession で置き換えています。SMA は、「connection.json」ファイルの接続を置き換えるテンプレートも追加し、この構成をconnection_parameter変数にロードしていることに注意してください。
推奨される修正
構成ファイル「connection.json」を必要な接続情報で更新する必要があります。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1054¶
メッセージ: pyspark.sql.readwriter.DataFrameReader.format is not supported.
カテゴリ: 警告。
説明¶
This issue appears when the pyspark.sql.readwriter.DataFrameReader.format has an argument that is not supported by Snowpark.
シナリオ¶
There are some scenarios depending on the type of format you are trying to load. It can be a supported , or non-supported format.
シナリオ1¶
入力
このツールは、読み込む形式のタイプを分析します。
Csv
JSON
Parquet
Orc
The below example shows how the tool transforms the format method when passing a Csv value.
出力
The tool transforms the format method into a Csv method call.
推奨される修正
この場合、ツールは EWI を表示しません。
シナリオ2¶
入力
The below example shows how the tool transforms the format method when passing a Jdbc value.
出力
The tool shows the EWI SPRKPY1054 indicating that the value "jdbc" is not supported.
推奨される修正
For the not supported scenarios, there is no specific fix since it depends on the files that are trying to be read.
シナリオ3¶
入力
The below example shows how the tool transforms the format method when passing a CSV, but using a variable instead.
出力
Since the tool can not determine the value of the variable in runtime, shows the EWI SPRKPY1054 indicating that the value "" is not supported.
推奨される修正
As a workaround, you can check the value of the variable and add it as a string to the format call.
その他の推奨事項¶
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¶
メッセージ: pyspark.sql.readwriter.DataFrameReader.option key value is not supported.
カテゴリ: 警告。
説明¶
This issue appears when the pyspark.sql.readwriter.DataFrameReader.option key value is not supported by SnowFlake.
このツールは、オプションコールのパラメーターを分析し、メソッド(CSV または JSON または PARQUET)によって、キー値にSnowparkでの等価値があるかないかを判断します。すべてのパラメーターに等価値がある場合、ツールは EWI を追加せず、キー値を等価値に置き換えます。そうでない場合、ツールは EWI を追加します。
等価性のリスト:
CSV の等価性:
Sparkオプションキー |
Snowparkの等価性 |
|---|---|
sep |
FIELD_DELIMITER |
header |
PARSE_HEADER |
lineSep |
RECORD_DELIMITER |
pathGlobFilter |
PATTERN |
quote |
FIELD_OPTIONALLY_ENCLOSED_BY |
nullValue |
NULL_IF |
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
inferSchema |
INFER_SCHEMA |
delimiter |
FIELD_DELIMITER |
JSON の等価性:
Sparkオプションキー |
Snowparkの等価性 |
|---|---|
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
pathGlobFilter |
PATTERN |
PARQUET の等価性:
Sparkオプションキー |
Snowparkの等価性 |
|---|---|
pathGlobFilter |
PATTERN |
上記の表にないキーオプションは、Snowparkではサポートされていないか、同等のものがありません。この場合、ツールは EWI にパラメーター情報を追加し、チェーンから削除します。
シナリオ¶
以下のシナリオは、 CSV、 JSON、 PARQUET に適用されます。
There are a couple of scenarios depending on the value of the key used in the option method.
シナリオ1¶
入力
Below is an example of a option call using a equivalent key.
出力
ツールは、キーを正しい等価値で変換します。
推奨される修正
ツールはキーの値を変換するため、修正する必要はありません。
シナリオ2¶
入力
Below is an example of a option call using a non-equivalent key.
出力
The tool adds the EWI SPRKPY1055 indicating the key is not supported and removes the option call.
推奨される修正
変換後の動作を確認することをお勧めします。
その他の推奨事項¶
非等価パラメーターが存在する場合は、変換後の動作を確認することをお勧めします。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1056¶
警告
この問題コードは、 廃止 されました。
メッセージ: pyspark.sql.readwriter.DataFrameReader.option argument _ <argument_name> _ is not a literal and can't be evaluated
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
Below is an example of a use of the pyspark.sql.readwriter.DataFrameReader.option function that generates this EWI.
出力
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.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1057¶
警告
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
カテゴリ: 警告。
説明¶
この問題コードは、廃止されました。古いバージョンをお使いの場合は、最新のバージョンにアップグレードしてください。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1058¶
メッセージ: < method > with < key > Platform specific key is not supported.
カテゴリ: ConversionError
説明¶
The get and set methods from pyspark.sql.conf.RuntimeConfig are not supported with a Platform specific key.
シナリオ¶
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.
シナリオ1¶
入力
Below is an example of the get or set methods with supported keys in Snowpark.
出力
Snowparkではキーがサポートされているため、ツールは出力コードに EWI を追加しません。
推奨される修正
このシナリオに対する推奨される修正はありません。
シナリオ2¶
入力
以下はサポートされていないキーを使用した例です。
出力
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.
推奨される修正
推奨される修正は、これらのメソッドを削除することです。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1059¶
警告
This issue code has been deprecated since Spark Conversion Core Version 2.45.1
Message: pyspark.storagelevel.StorageLevel has a workaround, see documentation.
カテゴリ: 警告
説明¶
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
その他の推奨事項¶
アプリケーションを最新バージョンにアップグレードします。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1060¶
メッセージ:The authentication mechanism is connection.json (template provided).
カテゴリ: 警告。
説明¶
This issue appears when the tool detects the usage of pyspark.conf.SparkConf.
シナリオ¶
入力
Snowparkでは認証コードが異なるため、ツールは使用を削除し、代わりに 接続構成ファイル(connection.json) を作成します。
出力
The tool adds the EWI SPRKPY1060 indicating that the authentication mechanism is different.
推奨される修正
To create a connection it is necessary that you fill in the information in the connection.json file.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1061¶
メッセージ:Snowpark does not support unix_timestamp functions
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
Below an example that calls the unix_timestamp method without parameters.
出力
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.
推奨される修正
回避策として、少なくともタイムスタンプ文字列の名前または列を追加することができます。
その他の推奨事項¶
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¶
メッセージ:Snowpark does not support GroupedData.pivot without parameter "values".
カテゴリ: 警告
説明¶
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).
現時点では、Snowpark Pythonのピボット関数は、ピボットする値のリストを明示的に指定する必要があります。
シナリオ¶
シナリオ1¶
入力
The SMA detects an expression that matches the pattern dataFrame.groupBy("columnX").pivot("columnY") and the pivot does not have the values parameter.
出力
SMA は、「values」パラメーターのないピボット関数がサポートされていないことを示す EWI メッセージを追加します。
さらに、ピボット関数の2番目のパラメーターとして、列に翻訳される値のリストを計算するリスト読解を追加します。この操作は大容量のデータでは効率が悪いため、明示的に値を指定することをお勧めします。
推奨される修正
このシナリオでは、 SMA は、ピボット関数の2番目のパラメーターに、列に翻訳される値のリストを計算するリスト読解を追加します。
シナリオ2¶
入力
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.
出力
SMA は、「values」パラメーターのないピボット関数がサポートされていないことを示す EWI メッセージを追加します。
推奨される修正
以下のように、ピボット対象となる個別の値のリストを追加します。
その他の推奨事項¶
ピボットの対象となる明確な値のリストを計算することは、大容量のデータセットでは効率的な操作ではなく、ブロック呼び出しになる可能性があります。ピボットする明確な値のリストを明示的に指定することを検討してください。
ピボットする個別の値のリストを明示的に指定しない(非推奨)場合は、ピボット関数の第2引数に以下のコードを追加して、ランタイム時に値を推測することができます*
****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¶
メッセージ: pyspark.sql.pandas.functions.pandas_udf has workaround.
カテゴリ: 警告
説明¶
This issue appears when the tool detects the usage of pyspark.sql.pandas.functions.pandas_udf which has a workaround.
シナリオ¶
入力
pandas_udf関数は、大容量データを扱うユーザー定義関数を作成するために使用します。
出力
SMA は、pandas_udfに回避策があることを示す EWI メッセージを追加します。
推奨される修正
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.
その他の推奨事項¶
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.
カテゴリ: 警告
説明¶
この問題は、pyspark.streamingライブラリのいずれかの要素の使用をツールが検出した場合に発生します。
pyspark.streaming.listener.StreamingListener。
シナリオ¶
入力
以下は、この EWI をトリガーする要素の1つを使った例です。
出力
The SMA adds the EWI SPRKPY1064 on the output code to let you know that this function does not apply.
推奨される修正
The SMA removes the import statement and adds the issue to the Issues.csv inventory, remove any usages of the Spark element.
その他の推奨事項¶
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¶
メッセージ:The pyspark.context.SparkContext.broadcast does not apply since snowflake use data-clustering mechanism to compute the data.
カテゴリ: 警告
説明¶
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.
入力コード
この例ではブロードキャスト変数が作成され、この変数によってすべてのノードでデータをより効率的に共有することができます。
出力コード
SMA は、ブロードキャストが不要であることを示す EWI メッセージを追加します。
推奨される修正
使用されているすべてのpyspark.context.SparkContext.broadcastを削除します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1066¶
メッセージ:The Spark element does not apply since snowflake use micro-partitioning mechanism are created automatically.
カテゴリ: 警告
説明¶
この問題は、パーティションに関連する要素の使用をツールが検出した場合に発生します。
Those elements do not apply due the use of micro-partitions of Snowflake.
入力コード
In this example sortWithinPartitions it's used to create a partition in a DataFrame sorted by the specified column.
出力コード
SMA は、Spark要素が不要であることを示す EWI メッセージを追加します。
推奨される修正
要素の使用を削除します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1067¶
メッセージ:The pyspark.sql.functions.split has parameters that are not supported in Snowpark.
カテゴリ: 警告
説明¶
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.
シナリオ¶
シナリオ1¶
入力コード
この例では、split関数に2つ以上のパラメーターがあります。
出力コード
ツールは出力コードにこの EWI を追加して、2つ以上のパラメーターを持つ場合は、この関数がサポートされていないことを知らせます。
推奨される修正
2つのパラメーターのみを持つsplit関数を保持します。
シナリオ2¶
入力コード
この例では、split関数のパラメーターに正規表現パターンがあります。
出力コード
ツールは出力コードにこの EWI を追加して、正規表現パターンをパラメーターとして持つ場合は、この関数がサポートされていないことを知らせます。
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1068¶
メッセージ: toPandas contains columns of type ArrayType that is not supported and has a workaround.
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
ToPandas は、元の DataFrame のデータをPandas DataFrame として返します。
出力
ツールはこの EWI を追加して、 ArrayType のタイプの列がある場合に、toPandasがサポートされていないことを知らせますが、回避策があります。
推奨される修正
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1069¶
メッセージ:If partitionBy parameter is a list, Snowpark will throw an error.
カテゴリ: 警告
説明¶
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.
シナリオ¶
シナリオ1¶
入力コード:
このシナリオでは、partitionByパラメーターはリストではありません。
出力コード:
The tool adds the EWI SPRKPY1069 to let you know that Snowpark throws an error if parameter is a list.
推奨される修正
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.
シナリオ2¶
入力コード:
このシナリオでは、partitionByパラメーターはリストです。
出力コード:
The tool adds the EWI SPRKPY1069 to let you know that Snowpark throws an error if parameter is a list.
推奨される修正
If the value of the parameter is a list, then replace it with a ColumnOrSqlExpr.
その他の推奨事項¶
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.
カテゴリ: 警告
説明¶
以下が使用されている場合、
The tool analyzes the parameter mode to determinate if the value is overwrite.
シナリオ¶
シナリオ1¶
入力コード
このシナリオでは、ツールはmodeパラメーターが対応するbool値をセットできることを検出します。
出力コード:
The SMA tool analyzes the mode parameter, determinate that the value is overwrite and set the corresponding bool value
推奨される修正
このシナリオでは、ツールが対応する変換を実行したため、推奨される修正はありません。
シナリオ2:
入力コード
In this scenario the tool can not validate the value is overwrite.
出力コード:
SMA は、「上書き」するようにモードパラメーターが変換されたことを示す EWI メッセージが追加されますが、これは、変数値を確認して正しいブール値を設定した方が良いことを知らせるためでもあります。
推奨される修正
Check for the value of the parameter mode and add the correct value for the parameter overwrite.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1071¶
メッセージ:The function pyspark.rdd.RDD.getNumPartitions is not required in Snowpark.そのため、参照はすべて削除する必要があります。
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
getNumPartitions は、 RDD 上のパーティションの数を返します。
出力
ツールはこの EWI を追加して、 getNumPartitions が不要であることを知らせます。
推奨される修正
この関数の使用をすべて削除します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1072¶
メッセージ:The use of StorageLevel is not required in Snowpark.
カテゴリ: 警告。
説明¶
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.
その他の推奨事項¶
この関数の使用をすべて削除します。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1073¶
メッセージ: pyspark.sql.functions.udf without parameters or return type parameter are not supported
カテゴリ: 警告。
説明¶
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.
シナリオ¶
シナリオ1¶
入力
Pysparkでは、ユーザー定義関数を入力や戻り値のタイプのパラメーターなしで作成できます。
出力
Snowparkでは、Udf関数に入力や戻り値のタイプが必要です。これらは提供されておらず、 SMA は、これらのパラメーターを変換できません。
推奨される修正
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*.
シナリオ2¶
PySpark では、パラメーターなしで@udfデコレーターを使用できます。
入力
出力
In Snowpark all the parameters of a udf decorator are required.
推奨される修正
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.
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1074¶
メッセージ:File has mixed indentation (spaces and tabs).
カテゴリ: 解析エラー。
説明¶
この問題は、ファイルにインデントが混在していることをツールが検出した場合に発生します。つまり、ファイルには空白とタブを組み合わせてインデントしたコード行があります。
シナリオ¶
入力
Pysparkでは、インデントレベルに空白とタブを混合することができます。
出力
SMA は、混合インデントマーカーを扱えません。Pythonコードファイル SMA でこれが検出されると、最初の行に EWI SPRKPY1074 が追加されます。
推奨される修正
解決策は、すべてのインデント記号を同じにすることです。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1075¶
カテゴリ
警告。
説明¶
スキーマに基づいたフィルターや検証が必要な場合は、何らかのロジックを導入することが必要になる場合があります。
例¶
入力
出力
from_json関数では、スキーマは推論のために渡されるのではなく、検証のために使われます。この例をご参照ください。
例1: データ型を強制し、列名を変更する。
例2: 特定の列を選択する。
推奨事項¶
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.
カテゴリ: 警告。
説明¶
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:
すべてのパラメーターは、Snowparkでの同等の名前と一致します。この場合、ツールはパラメーターを.option()呼び出しに変換します。この場合、パラメーターはこの EWI を追加しません。
Snowparkで同等のパラメーターと一致しない場合があります。この場合、ツールはパラメーター情報とともにこの EWI を追加し、メソッド呼び出しから削除します。
等価性のリスト:
CSV の等価性:
Sparkキー |
Snowparkの等価性 |
|---|---|
sep |
FIELD_DELIMITER |
header |
PARSE_HEADER |
lineSep |
RECORD_DELIMITER |
pathGlobFilter |
PATTERN |
quote |
FIELD_OPTIONALLY_ENCLOSED_BY |
nullValue |
NULL_IF |
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
inferSchema |
INFER_SCHEMA |
delimiter |
FIELD_DELIMITER |
JSON の等価性:
Sparkキー |
Snowparkの等価性 |
|---|---|
dateFormat |
DATE_FORMAT |
timestampFormat |
TIMESTAMP_FORMAT |
pathGlobFilter |
PATTERN |
PARQUET の等価性:
Sparkキー |
Snowparkの等価性 |
|---|---|
pathGlobFilter |
PATTERN |
シナリオ¶
シナリオ1¶
入力
以下は CVS 用のいくつかの例です。
出力
変換後のコードでは、パラメーターはcvs関数の個々のオプションとして追加されます。
シナリオ2¶
入力
以下は JSON 用のいくつかの例です。
出力
変換後のコードでは、パラメーターはjson関数に個別のオプションとして追加されます。
シナリオ3¶
入力
以下は PARQUET 用のいくつかの例です。
出力
変換後のコードでは、パラメーターは個々のオプションとしてparquet関数に追加されます。
その他の推奨事項¶
非等価パラメーターが存在する場合は、変換後の動作を確認することをお勧めします。
また、ドキュメントはより良い適合を見つけるのに役立ちます。
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¶
メッセージ: SQL embedded code cannot be processed.
カテゴリ: 警告。
説明¶
この問題は、Snowparkに変換できない SQL 埋め込みコードをツールが検出した場合に表示されます。
詳細情報については、 SQL 埋め込みコードのセクションをご確認ください。
シナリオ¶
入力
この例では、 SQL のコードを、Pyspark.sqlメソッドのパラメーターとして使用されるqueryという変数に埋め込んでいます。
出力
SMA は、 PySpark.sqlパラメーターが変数であり SQL コードではないことを検出するため、 EWI SPRKPY1077 メッセージが PySpark.sql行に追加されます。
その他の推奨事項¶
SQL の変換の場合、このコードは文字列値としてのみ、かつ補間なしでメソッドのパラメーターとして直接内部にある必要があります。PySpark.SQL 関数に SQL を送信し、Snowflakeでの機能を検証してください。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1078¶
メッセージ:The argument of the pyspark.context.SparkContext.setLogLevel function is not a literal value and therefore could not be evaluated
カテゴリ: 警告
説明¶
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 はソースコードの静的分析を行うため、引数の内容を評価し、Snowparkで同等のものを決定することはできません。
シナリオ¶
入力
この例では、logLevelは変数my_log_levelで定義され、 setLogLevel メソッドのパラメーターとしてmy_log_levelが使用されます。
出力
SMA はログレベルパラメーターの引数を評価できないため、 EWI SPRKPY1078 は変換されたログの行の上に追加されます
推奨される修正
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 ログレベル |
Snowparkログレベル同等 |
|---|---|
ALL |
logging.NOTSET |
DEBUG |
logging.DEBUG |
ERROR |
logging.ERROR |
FATAL |
logging.CRITICAL |
INFO |
logging.INFO |
OFF |
logging.WARNING |
TRACE |
logging.NOTSET |
WARN |
logging.WARNING |
したがって、推奨される修正は次のようになります。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1079¶
メッセージ:The argument of the pyspark.context.SparkContext.setLogLevel function is not a valid PySpark log level
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
ここでは、ログレベルに「INVALID_LOG_LEVEL」が使用されていますが、これは有効なPysparkログレベルではありません。
出力
SMA がログレベル「INVALID_LOG_LEVEL」を認識できない場合、 SMA が変換するにもかかわらず、 EWI SPRKPY1079 が追加され、問題が発生する可能性があることを示します。
推奨される修正
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.
その他の推奨事項¶
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
メッセージ: pyspark.sql.readwriter.DataFrameWriter.partitionBy has a workaround.
カテゴリ: 警告
説明¶
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.
シナリオ¶
入力
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.
出力コード
推奨される修正
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コード:
手動で調整したSnowparkコード:
copy_into_location には以下のパラメーターがあります。
location: The Snowpark location only accepts cloud locations using an snowflake stage.
_partition_by_: これは列名または SQL 式です。したがって、colまたはsql_exprを使用して列または SQL に変換する必要があります。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1082¶
メッセージ:The pyspark.sql.readwriter.DataFrameReader.load function is not supported.回避策としては、代わりにSnowpark DataFrameReader 形式固有のメソッド(avro csv、json、orc、parquet)を使用します。パスのパラメーターは、ステージロケーションにする必要があります。
カテゴリ: 警告
説明¶
The pyspark.sql.readwriter.DataFrameReader.load function is not supported. The workaround is to use Snowpark DataFrameReader methods instead.
シナリオ¶
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.
シナリオ1¶
入力
Below is an example that tries to load data from a CSV source.
出力
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
推奨される修正
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.
シナリオ2¶
入力
Below is an example that tries to load data from a JSON source.
出力
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
推奨される修正
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.
シナリオ3¶
入力
Below is an example that tries to load data from a PARQUET source.
出力
The SMA adds the EWI SPRKPY1082 to let you know that this function is not supported by Snowpark, but it has a workaround.
推奨される修正
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.
その他の推奨事項¶
SparkとSnowparkの間のオプションは同じではありませんが、マッピングが可能であることを考慮します。
Sparkオプション |
可能な値 |
Snowpark同等 |
説明 |
|---|---|---|---|
header |
TrueまたはFalse |
SKIP_HEADER = 1 / SKIP_HEADER = 0 |
ファイルの最初の行を列の名前として使用します。 |
delimiter |
任意の1文字/複数文字のフィールドセパレーター |
FIELD_DELIMITER |
各列/フィールドのセパレーターとして単一/複数の文字を指定します。 |
sep |
任意の1文字フィールドセパレーター |
FIELD_DELIMITER |
各列/フィールドのセパレーターとして1文字を指定します。 |
encoding |
UTF-8、 UTF-16など。 |
ENCODING |
CSV ファイルを指定されたエンコードタイプでデコードします。デフォルトのエンコーディングは UTF-8です |
lineSep |
任意の1文字の行セパレーター |
RECORD_DELIMITER |
ファイルの解析に使用する行セパレーターを定義します。 |
pathGlobFilter |
ファイルパターン |
PATTERN |
パターンを定義して、そのパターンに一致するファイル名のファイルだけを読み込むようにします。 |
recursiveFileLookup |
TrueまたはFalse |
N/A |
再帰的にディレクトリをスキャンしてファイルを読み込みます。このオプションのデフォルト値はFalseです。 |
quote |
引用される1文字 |
FIELD_OPTIONALLY_ENCLOSED_BY |
区切り文字/セパレーターが値の一部となり得るフィールドを含むフィールド/列を引用します。この文字をquoteAllオプションと併用すると、すべてのフィールドを引用します。このオプションのデフォルト値は二重引用符(")です。 |
nullValue |
nullに置き換える文字列 |
NULL_IF |
データフレームの読み書きの際にnull値を文字列で置き換えます。 |
dateFormat |
有効な日付形式 |
DATE_FORMAT |
日付形式を示す文字列を定義します。デフォルトの形式はyyyy-MM-ddです。 |
timestampFormat |
有効なタイムスタンプ形式 |
TIMESTAMP_FORMAT |
タイムスタンプ形式を示す文字列を定義します。デフォルトの形式はyyyy-MM-dd 'T'HH:mm:ssです。 |
escape |
任意の1文字 |
ESCAPE |
デフォルトのエスケープ文字(\)を上書きする、単一の文字をエスケープ文字として設定します。 |
inferSchema |
TrueまたはFalse |
INFER_SCHEMA |
ファイルスキーマを自動検出します |
mergeSchema |
TrueまたはFalse |
N/A |
Snowflakeでは、infer_schemaがParquetファイル構造を決定するたびに発生するため、必要ありません。 |
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¶
メッセージ:The pyspark.sql.readwriter.DataFrameWriter.save function is not supported.回避策としては、代わりにSnowpark DataFrameWriter copy_into_locationメソッドを使用します。
カテゴリ: 警告
説明¶
The pyspark.sql.readwriter.DataFrameWriter.save function is not supported. The workaround is to use Snowpark DataFrameWriter methods instead.
シナリオ¶
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.
シナリオ1¶
入力コード
Below is an example that tries to save data with CSV format.
出力コード
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.
推奨される修正
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.
以下は、仮ステージを作成し、そこにファイルを入れ、上記のメソッドを呼び出す例です。
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.
シナリオ2¶
入力コード
Below is an example that tries to save data with JSON format.
出力コード
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.
推奨される修正
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.
以下は、仮ステージを作成し、そこにファイルを入れ、上記のメソッドを呼び出す例です。
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.
シナリオ3¶
入力コード
Below is an example that tries to save data with PARQUET format.
出力コード
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.
推奨される修正
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.
以下は、仮ステージを作成し、そこにファイルを入れ、上記のメソッドを呼び出す例です。
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.
その他の推奨事項¶
SparkとSnowparkの間のオプションは同じではありませんが、マッピングが可能であることを考慮します。
Sparkオプション |
可能な値 |
Snowpark同等 |
説明 |
|---|---|---|---|
header |
TrueまたはFalse |
SKIP_HEADER = 1 / SKIP_HEADER = 0 |
ファイルの最初の行を列の名前として使用します。 |
delimiter |
任意の1文字/複数文字のフィールドセパレーター |
FIELD_DELIMITER |
各列/フィールドのセパレーターとして単一/複数の文字を指定します。 |
sep |
任意の1文字フィールドセパレーター |
FIELD_DELIMITER |
各列/フィールドのセパレーターとして1文字を指定します。 |
encoding |
UTF-8、 UTF-16など。 |
ENCODING |
CSV ファイルを指定されたエンコードタイプでデコードします。デフォルトのエンコーディングは UTF-8です |
lineSep |
任意の1文字の行セパレーター |
RECORD_DELIMITER |
ファイルの解析に使用する行セパレーターを定義します。 |
pathGlobFilter |
ファイルパターン |
PATTERN |
パターンを定義して、そのパターンに一致するファイル名のファイルだけを読み込むようにします。 |
recursiveFileLookup |
TrueまたはFalse |
N/A |
再帰的にディレクトリをスキャンしてファイルを読み込みます。このオプションのデフォルト値はFalseです。 |
quote |
引用される1文字 |
FIELD_OPTIONALLY_ENCLOSED_BY |
区切り文字/セパレーターが値の一部となり得るフィールドを含むフィールド/列を引用します。この文字をquoteAllオプションと併用すると、すべてのフィールドを引用します。このオプションのデフォルト値は二重引用符(")です。 |
nullValue |
nullに置き換える文字列 |
NULL_IF |
データフレームの読み書きの際にnull値を文字列で置き換えます。 |
dateFormat |
有効な日付形式 |
DATE_FORMAT |
日付形式を示す文字列を定義します。デフォルトの形式はyyyy-MM-ddです。 |
timestampFormat |
有効なタイムスタンプ形式 |
TIMESTAMP_FORMAT |
タイムスタンプ形式を示す文字列を定義します。デフォルトの形式はyyyy-MM-dd 'T'HH:mm:ssです。 |
escape |
任意の1文字 |
ESCAPE |
デフォルトのエスケープ文字(\)を上書きする、単一の文字をエスケープ文字として設定します。 |
inferSchema |
TrueまたはFalse |
INFER_SCHEMA |
ファイルスキーマを自動検出します |
mergeSchema |
TrueまたはFalse |
N/A |
Snowflakeでは、infer_schemaがParquetファイル構造を決定するたびに発生するため、必要ありません。 |
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
メッセージ: pyspark.sql.readwriter.DataFrameWriter.option is not supported.
カテゴリ: 警告
説明¶
The pyspark.sql.readwriter.DataFrameWriter.option function is not supported.
シナリオ¶
入力コード
Below is an example using the option method, this method is used to add additional configurations when writing the data of a DataFrame.
出力コード
The tool adds this EWI SPRKPY1084 on the output code to let you know that this function is not supported by Snowpark.
推奨される修正
pyspark.sql.readwriter.DataFrameWriter.optionメソッドには推奨される修正がありません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1085¶
メッセージ: pyspark.ml.feature.VectorAssembler is not supported.
カテゴリ: 警告
説明¶
The pyspark.ml.feature.VectorAssembler is not supported.
シナリオ¶
入力コード
VectorAssembler は、複数の列を1つのベクトルに結合するために使用されます。
出力コード
The tool adds this EWI SPRKPY1085 on the output code to let you know that this class is not supported by Snowpark.
推奨される修正
pyspark.ml.feature.VectorAssembler には推奨される修正がありません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1086¶
メッセージ: pyspark.ml.linalg.VectorUDT is not supported.
カテゴリ: 警告
説明¶
The pyspark.ml.linalg.VectorUDT is not supported.
シナリオ¶
入力コード
VectorUDT は、 DataFrame のベクトル列を表すデータ型です。
出力コード
The tool adds this EWI SPRKPY1086 on the output code to let you know that this function is not supported by Snowpark.
推奨される修正
pyspark.ml.linalg.VectorUDT には推奨される修正がありません。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1087¶
メッセージ:The pyspark.sql.dataframe.DataFrame.writeTo function is not supported, but it has a workaround.
カテゴリ: 警告。
説明¶
The pyspark.sql.dataframe.DataFrame.writeTo function is not supported. The workaround is to use Snowpark DataFrameWriter SaveAsTable method instead.
シナリオ¶
入力
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.
出力
The SMA adds the EWI SPRKPY1087 to the output code to let you know that this function is not supported, but has a workaround.
推奨される修正
回避策としては、代わりにSnowpark DataFrameWriter SaveAsTable メソッドを使用します。
その他の推奨事項¶
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1088¶
メッセージ:The pyspark.sql.readwriter.DataFrameWriter.option values in Snowpark may be different, so required validation might be needed.
カテゴリ: 警告
説明¶
The pyspark.sql.readwriter.DataFrameWriter.option values in Snowpark may be different, so validation might be needed to ensure that the behavior is correct.
シナリオ¶
サポートされているかどうかのオプションや、ファイルの書き込みに使用される形式によって、いくつかのシナリオがあります。
シナリオ1¶
入力
Below is an example of the usage of the method option, adding a sep option, which is currently supported.
出力
The tool adds the EWI SPRKPY1088 indicating that it is required validation.
推奨される修正
Snowpark API はこのパラメーターをサポートしているため、唯一のアクションは移行後の動作を確認することです。サポートされるパラメーターについては、 等価表 をご参照ください。
シナリオ2¶
入力
Here the scenario shows the usage of option, but adds a header option, which is not supported.
出力
The tool adds the EWI SPRKPY1088 indicating that it is required validation is needed.
推奨される修正
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.
シナリオ3¶
入力
This scenario adds a sep option, which is supported and uses the JSON method.
Note: this scenario also applies for
PARQUET.
出力
The tool adds the EWI SPRKPY1088 indicating that it is required validation is needed.
推奨される修正
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.
その他の推奨事項¶
Since there are some
not supportedparameters, it is recommended to check thetable of equivalencesand check the behavior after the transformation.等価表:
PySpark オプション |
SnowFlake オプション |
サポートされているファイル形式 |
説明 |
|---|---|---|---|
SEP |
FIELD_DELIMITER |
CSV |
入力ファイルのフィールドを区切る、1バイトまたは複数バイトの文字。 |
LINESEP |
RECORD_DELIMITER |
CSV |
入力ファイルの記録を区切る、1つ以上の文字。 |
QUOTE |
FIELD_OPTIONALLY_ENCLOSED_BY |
CSV |
文字列を囲むのに使用される文字。 |
NULLVALUE |
NULL_IF |
CSV |
SQL NULL との間の変換に使用される文字列。 |
DATEFORMAT |
DATE_FORMAT |
CSV |
ロードするデータファイルの日付値の形式を定義する文字列。 |
TIMESTAMPFORMAT |
TIMESTAMP_FORMAT |
CSV |
ロードするデータファイルのタイムスタンプ値の形式を定義する文字列。 |
使用されたパラメーターがリストにない場合、 API はエラーをスローします。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1089¶
メッセージ:The pyspark.sql.readwriter.DataFrameWriter.options values in Snowpark may be different, so required validation might be needed.
カテゴリ: 警告
説明¶
The pyspark.sql.readwriter.DataFrameWriter.options values in Snowpark may be different, so validation might be needed to ensure that the behavior is correct.
シナリオ¶
オプションがサポートされているかどうか、またはファイルの書き込みに使用される形式によって、いくつかのシナリオがあります。
シナリオ1¶
入力
Below is an example of the usage of the method options, adding the options sep and nullValue, which are currently supported.
出力
The tool adds the EWI SPRKPY1089 indicating that it is required validation.
推奨される修正
Snowpark API はこれらのパラメーターをサポートしているため、唯一のアクションは移行後の動作を確認することです。サポートされるパラメーターについては、 等価表 をご参照ください。
シナリオ2¶
入力
Here the scenario shows the usage of options, but adds a header option, which is not supported.
出力
The tool adds the EWI SPRKPY1089 indicating that it is required validation is needed.
推奨される修正
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.
シナリオ3¶
入力
This scenario adds a sep option, which is supported and uses the JSON method.
出力
The tool adds the EWI SPRKPY1089 indicating that it is required validation is needed.
Note: this scenario also applies for
PARQUET.
推奨される修正
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.
その他の推奨事項¶
Since there are some
not supportedparameters, it is recommended to check thetable of equivalencesand check the behavior after the transformation.等価表:
Snowparkはいくつかのパラメーターについて、 等価 のリストをサポートすることができます。
PySpark オプション |
SnowFlake オプション |
サポートされているファイル形式 |
説明 |
|---|---|---|---|
SEP |
FIELD_DELIMITER |
CSV |
入力ファイルのフィールドを区切る、1バイトまたは複数バイトの文字。 |
LINESEP |
RECORD_DELIMITER |
CSV |
入力ファイルの記録を区切る、1つ以上の文字。 |
QUOTE |
FIELD_OPTIONALLY_ENCLOSED_BY |
CSV |
文字列を囲むのに使用される文字。 |
NULLVALUE |
NULL_IF |
CSV |
SQL NULL との間の変換に使用される文字列。 |
DATEFORMAT |
DATE_FORMAT |
CSV |
ロードするデータファイルの日付値の形式を定義する文字列。 |
TIMESTAMPFORMAT |
TIMESTAMP_FORMAT |
CSV |
ロードするデータファイルのタイムスタンプ値の形式を定義する文字列。 |
使用されたパラメーターがリストにない場合、 API はエラーをスローします。
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
SPRKPY1101¶
カテゴリ¶
解析エラー。
説明¶
ツールが解析エラーを認識すると、そのエラーから回復しようとし、次の行で処理を続行します。これらの場合、行にエラーとコメントが表示されます。
この例では、スペースとタブの不一致エラーがどのように処理されるかを示しています。
入力コード
出力コード
推奨事項¶
コメントされている行を修正してみてください。
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.