Pyarrow:如何在 structType 中转换数据类型?

问题描述

我有一个镶木地板文件,当我从中读取数据时,我得到以下架构:

pyarrow.Table
schema0: struct<crm: struct<task: struct<ACTIVITY_STATUS: string,CREATED_ON: timestamp[us],TASK_ID: string,esitoInfo: struct<ESITO: string>,timeInfo: struct<ACTUAL_END: null,DATA_SCADENZA_TASK: timestamp[us]>>,ticket: struct<TICKET_ID: string>>,eventType: string,identities: struct<ID_CONTO: string>>
  child 0,crm: struct<task: struct<ACTIVITY_STATUS: string,ticket: struct<TICKET_ID: string>>
      child 0,task: struct<ACTIVITY_STATUS: string,DATA_SCADENZA_TASK: timestamp[us]>>
          child 0,ACTIVITY_STATUS: string
          child 1,CREATED_ON: timestamp[us]
          child 2,TASK_ID: string
          child 3,esitoInfo: struct<ESITO: string>
              child 0,ESITO: string
HERE      child 4,DATA_SCADENZA_TASK: timestamp[us]>          HERE
HERE          child 0,ACTUAL_END: null                                                           HERE
              child 1,DATA_SCADENZA_TASK: timestamp[us]
      child 1,ticket: struct<TICKET_ID: string>
          child 0,TICKET_ID: string
  child 1,eventType: string
  child 2,identities: struct<ID_CONTO: string>
      child 0,ID_CONTO: string
_id: string
timestamp: timestamp[us]

如您所见,我已将列类型为“空”的字段标记为“此处”,即使其所有元素都为空(因此它被推断为空),我也想将其转换为日期时间。 有没有办法做到这一点?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...