Associate-Developer-Apache-Spark 試験問題 31
列 productId および itemId での DataFrame transactionsDf および itemsDf の内部結合の結果、DataFrame の列値が空でないレコードの数を返すには、以下に示すコード ブロックをどの順序で実行する必要がありますか?
1. .filter(~isnull(col('value')))
2. .count()
3. transactionsDf.join(itemsDf, col("transactionsDf.productId")==col("itemsDf.itemId"))
4. transactionsDf.join(itemsDf, transactionsDf.productId==itemsDf.itemId, how='inner')
5. .filter(col('value').isnotnull())
6. .sum(col('値'))
1. .filter(~isnull(col('value')))
2. .count()
3. transactionsDf.join(itemsDf, col("transactionsDf.productId")==col("itemsDf.itemId"))
4. transactionsDf.join(itemsDf, transactionsDf.productId==itemsDf.itemId, how='inner')
5. .filter(col('value').isnotnull())
6. .sum(col('値'))
Associate-Developer-Apache-Spark 試験問題 32
以下に示すコード ブロックは、DataFrame transactionsDf のすべての列を含む DataFrame を返しますが、列 productId の値が少なくとも 2 である最大 2 行のみを返します。これを達成するには、コード ブロックの空白を正しく埋める答えを選択してください。
トランザクションDf.__1__(__2__).__3__
トランザクションDf.__1__(__2__).__3__
Associate-Developer-Apache-Spark 試験問題 33
以下に表示されているコード ブロックにはエラーが含まれています。コード ブロックは、列 predError の値が少なくとも 5 である DataFrame transactionsDf からの行のみを含む新しい DataFrame を返す必要があります。エラーを見つけます。
コードブロック:
transactionsDf.where("col(predError) >= 5")
コードブロック:
transactionsDf.where("col(predError) >= 5")
Associate-Developer-Apache-Spark 試験問題 34
次のうち、Spark のアダプティブ クエリ実行について説明しているのはどれですか?
Associate-Developer-Apache-Spark 試験問題 35
次のコード ブロックのうち、列 predError と DataFrame transactionsDf の 2 行ごとの値のみを含む新しい DataFrame を返すのはどれですか?
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.| 4| ヌル| ヌル| 3| 2|ヌル|
8.| 5| ヌル| ヌル| ヌル| 2|ヌル|
9.| 6| 3| 2| 25| 2|ヌル|
10.+-------------+---------+-----+-------+--------- +----+
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.| 4| ヌル| ヌル| 3| 2|ヌル|
8.| 5| ヌル| ヌル| ヌル| 2|ヌル|
9.| 6| 3| 2| 25| 2|ヌル|
10.+-------------+---------+-----+-------+--------- +----+