DataX icon indicating copy to clipboard operation
DataX copied to clipboard

对于hive分区表同步到mysql,为啥hive中的分区字段同步过去的都是null呢?

Open ocean-zhc opened this issue 6 years ago • 2 comments

期待回复

ocean-zhc avatar Sep 29 '19 07:09 ocean-zhc

我也遇到了这个问题,请问找到原因解决了吗?

wdx-best avatar Nov 09 '22 06:11 wdx-best

https://blog.csdn.net/qq_46893497/article/details/111221503这个链接可以有点帮助

wdx-best avatar Nov 09 '22 07:11 wdx-best

把需要的分区分区值,配置成常量即可

例如:

{
    "name": "hdfsreader",
    "parameter": {
        "path": "/user/hive/warehouse/mytable01/pt=20230215",
        "defaultFS": "hdfs://xxx:port",
        "column": [
            {
                "index": 0,
                "type": "long"
            },
            {
                "index": 1,
                "type": "boolean"
            },
            {
                "type": "string",
                "value": "20230215"
            },
            {
                "index": 2,
                "type": "double"
            }
        ],
        "fileType": "orc",
        "encoding": "UTF-8",
        "fieldDelimiter": ","
    }
}

dingxiaobo avatar Feb 15 '23 12:02 dingxiaobo