Associate-Developer-Apache-Spark 試験問題 41
次のコード ブロックのうち、列名と型の両方を含むツリーのような方法で DataFrame の構造を示しているのはどれですか?
Associate-Developer-Apache-Spark 試験問題 42
次のコード ブロックのうち、DataFrame itemsDf をディスクの保存場所 filePath に書き込み、その場所にある既存のデータを確実に置き換えるのはどれですか?
Associate-Developer-Apache-Spark 試験問題 43
DataFrame transactionsDf を指定すると、次の出力を生成するコード ブロックはどれですか?
出力:
1.ルート
2. |-- transactionId: 整数 (nullable = true)
3. |-- predError: 整数 (nullable = true)
4. |-- 値: 整数 (nullable = true)
5. |-- storeId: 整数 (nullable = true)
6. |-- productId: 整数 (nullable = true)
7. |-- f: 整数 (nullable = true)
DataFrame トランザクションDf:
1.+-------------+---------+-----+-------+--------- +----+
2.|transactionId|predError|value|storeId|productId| ふ|
3.+-------------+---------+-----+-------+--------- +----+
4.| 1| 3| 4| 25| 1|ヌル|
5.| 2| 6| 7| 2| 2|ヌル|
6.| 3| 3| ヌル| 25| 3|ヌル|
7.+-------------+---------+-----+-------+--------- +----+
出力:
1.ルート
2. |-- transactionId: 整数 (nullable = true)
3. |-- predError: 整数 (nullable = true)
4. |-- 値: 整数 (nullable = true)
5. |-- storeId: 整数 (nullable = true)
6. |-- productId: 整数 (nullable = true)
7. |-- f: 整数 (nullable = true)
DataFrame トランザクションDf:
1.+-------------+---------+-----+-------+--------- +----+
2.|transactionId|predError|value|storeId|productId| ふ|
3.+-------------+---------+-----+-------+--------- +----+
4.| 1| 3| 4| 25| 1|ヌル|
5.| 2| 6| 7| 2| 2|ヌル|
6.| 3| 3| ヌル| 25| 3|ヌル|
7.+-------------+---------+-----+-------+--------- +----+
Associate-Developer-Apache-Spark 試験問題 44
以下に表示されているコード ブロックには、少なくとも 1 つのエラーが含まれています。コード ブロックは、result という 1 つの列のみを含む DataFrame を返す必要があります。その列には、5 のべき乗された DataFrame transactionsDf の列値のすべての値と、列値に値がない行の null 値が含まれている必要があります。エラーを見つけます。
コードブロック:
1.from pyspark.sql.functions import udf
2.from pyspark.sql import types as T
3.
4.transactionsDf.createOrReplaceTempView('トランザクション')
5.
6.def pow_5(x):
7. x**5 を返す
8.
9.spark.udf.register(pow_5, 'power_5_udf', T.LongType())
10.spark.sql('select power_5_udf(value) FROM transactions')
コードブロック:
1.from pyspark.sql.functions import udf
2.from pyspark.sql import types as T
3.
4.transactionsDf.createOrReplaceTempView('トランザクション')
5.
6.def pow_5(x):
7. x**5 を返す
8.
9.spark.udf.register(pow_5, 'power_5_udf', T.LongType())
10.spark.sql('select power_5_udf(value) FROM transactions')
Associate-Developer-Apache-Spark 試験問題 45
次のうち、Spark で計算クエリを実行プランに変換する方法を説明しているのはどれですか?