小编Rav*_*avi的帖子

Spark:联合只能在具有兼容列类型的表上执行。Struct <名称,ID>!= Struct <ID,名称>

错误:只能对具有兼容列类型的表执行联合。 struct(tier:string,skyward_number:string,skyward_points:string)<> struct(skyward_number:string,tier:string,skyward_points:string)在第二个表的第一列;

此处struct字段的顺序不同,但其余部分都相同。

dataframe1架构

root
 |-- emcg_uuid: string (nullable = true)
 |-- name: string (nullable = true)
 |-- phone_no: string (nullable = true)
 |-- dob: string (nullable = true)
 |-- country: string (nullable = true)
 |-- travel_type: string (nullable = true)
 |-- gdpr_restricted_flg: string (nullable = false)
 |-- gdpr_reason_code: string (nullable = false)
 |-- document: map (nullable = true)
 |    |-- key: string
 |    |-- value: string (valueContainsNull = true)
 |-- skyward: struct (nullable = false)
 |    |-- …
Run Code Online (Sandbox Code Playgroud)

union struct apache-spark apache-spark-sql

5
推荐指数
2
解决办法
2967
查看次数

Google 秘密管理器使用 python3.11 和秘密管理器 2.16.0 抛出“AccessSecretVersionRequest 的构造函数输入无效”

下面的代码片段抛出异常AccessSecretVersionRequest 的构造函数输入无效

from google.cloud import secretmanager
from google.oauth2 import service_account

client = secretmanager.SecretManagerServiceClient()

    name = client.secret_version_path(
        project=GOOGLE_CLOUD_PROJECT_ID,
        secret=SECRET_NAME,
        secret_version=SECRET_VERSION
    )

    api_key = secretmanager_client.access_secret_version(name=name).payload.data.decode("utf-8")

Run Code Online (Sandbox Code Playgroud)

google-cloud-platform python-3.11

5
推荐指数
1
解决办法
1584
查看次数