假设我有一个名为DAT_015_X的字符串列,其格式为'yyyyMMdd'。
我想在日期'20190101'之前创建一个过滤器。
我只是加载我的数据:
cassandra.
我转储了数据,并且没有问题。没有空间或任何问题。
要编写过滤器,请执行以下操作:
CRE_22002 = LOAD '$input' USING PigStorage(';') AS (GM_COMPTEUR:chararray,CIA_CD_CRV_CIA:chararray,CIA_DA_EM_CRV:chararray,CIA_CD_CTRL_BLCE:chararray,CIA_IDC_EXTR_RDJ:chararray,CIA_VLR_IDT_CRV_LOQ:chararray,CIA_VLR_REF_CRV:chararray,CIA_NO_SEQ_CRV:chararray,CIA_VLR_LG_ZON_RTG:chararray,CIA_HEU_CIA:chararray,CIA_TM_STP_CRE:chararray,CIA_CD_SI:chararray,CIA_VLR_1:chararray,CIA_DA_ARR_FIC:chararray,CIA_TY_ENR:chararray,CIA_CD_BTE:chararray,CIA_CD_PER:chararray,CIA_CD_EFS:chararray,CIA_CD_ETA_VAL_CRV:chararray,CIA_CD_EVE_CPR:chararray,CIA_CD_APLI_TDU:chararray,CIA_CD_STE_RTG:chararray,CIA_DA_TT_RTG:chararray,CIA_NO_ENR_RTG:chararray,CIA_DA_VAL_EVE:chararray,PSE_001:chararray,STR_002:chararray,STR_003:chararray,CPR_006_VLR:chararray,CPR_006_DCM:chararray,CPR_006_CD_DVS:chararray,CPR_008_VLR:chararray,CPR_008_DCM:chararray,CPR_008_CD_DVS:chararray,CPR_009_VLR:chararray,CPR_009_DCM:chararray,CPR_009_CD_DVS:chararray,CPR_059_VLR:chararray,CPR_059_DCM:chararray,CPR_059_CD_DVS:chararray,CPR_060_VLR:chararray,CPR_060_DCM:chararray,CPR_060_CD_DVS:chararray,RUB_205:chararray,RUB_216:int,DAT_015_X:chararray,NB_005_VLR:chararray,NB_005_DCM:chararray,NB_007_VLR:chararray,NB_007_DCM:chararray,NB_012_VLR:chararray,NB_012_DCM:chararray,EUR_061_VLR:chararray,EUR_061_DCM:chararray,EUR_061_CD_DVS:chararray,EUR_062_VLR:chararray,EUR_062_DCM:chararray,EUR_062_CD_DVS:chararray);
我收到此错误:
无法推断与之匹配的功能 org.apache.pig.builtin.ToDate为多个或都不适合。请 使用显式强制转换。
编辑 @ VK_217例如,我用$ 45代替了$ 44,因为这是正确的位置。
CRE_22002_DATA_FILTER = FILTER CRE_22002 BY (ToDate($45,'yyyyMMdd')> ToDate('20190101','yyyyMMdd'));
但是总是有一个错误:
[]]:java.lang.IllegalArgumentException:无效格式:“ DAT_015_X”
(DAT_015_X)
(99991231)
(20200605)
(20190605)
(20200605)
(20200305)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(20200110)
(99991231)
(99991231)
(99991231)
(20190501)
(99991231)
(20190905)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(20190605)
(99991231)
(99991231)
(20190905)
(99991231)
(20190915)
(20190805)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(99991231)
(20200110)
(99991231)
(20190705)
请问您如何解释?