@@ -916,10 +916,13 @@ private TsBlock getTransferedDataTypeTsBlock(TsBlock tsBlock) {
916916 if (length > 0 ) {
917917 for (int i = 0 ; i < length ; i ++) {
918918 TSDataType finalDataType = getTsDataTypeList ().get (i );
919- if ((valueColumns [i ].getDataType () != finalDataType )
920- && (!SchemaUtils .isUsingSameColumn (valueColumns [i ].getDataType (), finalDataType )
921- || (valueColumns [i ].getDataType ().equals (TSDataType .DATE )
922- && (finalDataType == TSDataType .STRING || finalDataType == TSDataType .TEXT )))) {
919+ if ((valueColumns [i ].getDataType ().equals (TSDataType .DATE )
920+ && (valueColumns [i ].getDataType () != TSDataType .INT32 ))
921+ || ((valueColumns [i ].getDataType () != finalDataType )
922+ && (!SchemaUtils .isUsingSameColumn (valueColumns [i ].getDataType (), finalDataType )
923+ || (valueColumns [i ].getDataType ().equals (TSDataType .DATE )
924+ && (finalDataType == TSDataType .STRING
925+ || finalDataType == TSDataType .TEXT ))))) {
923926 isTypeInconsistent = true ;
924927 break ;
925928 }
@@ -1230,14 +1233,19 @@ private TsBlock getTransferedDataTypeTsBlock(TsBlock tsBlock) {
12301233 break ;
12311234 case DATE :
12321235 if (SchemaUtils .isUsingSameColumn (sourceType , TSDataType .DATE )) {
1233- newValueColumns [i ] = valueColumns [i ];
1236+ newValueColumns [i ] =
1237+ new IntColumn (
1238+ positionCount , Optional .of (new boolean [positionCount ]), new int [positionCount ]);
1239+ for (int j = 0 ; j < valueColumns [i ].getPositionCount (); j ++) {
1240+ newValueColumns [i ].isNull ()[j ] = valueColumns [i ].isNull ()[j ];
1241+ if (!valueColumns [i ].isNull ()[j ]) {
1242+ newValueColumns [i ].getInts ()[j ] = valueColumns [i ].getInts ()[j ];
1243+ }
1244+ }
12341245 } else {
12351246 newValueColumns [i ] =
12361247 new IntColumn (
1237- positionCount ,
1238- Optional .of (new boolean [positionCount ]),
1239- new int [positionCount ],
1240- TSDataType .DATE );
1248+ positionCount , Optional .of (new boolean [positionCount ]), new int [positionCount ]);
12411249 for (int j = 0 ; j < valueColumns [i ].getPositionCount (); j ++) {
12421250 newValueColumns [i ].isNull ()[j ] = true ;
12431251 }
@@ -1931,18 +1939,15 @@ private boolean typeCompatible(ITimeSeriesMetadata timeseriesMetadata) {
19311939 return true ;
19321940 }
19331941 if (valueTimeseriesMetadataList != null ) {
1934- int incompactibleCount = 0 ;
19351942 for (int i = 0 , size = getTsDataTypeList ().size (); i < size ; i ++) {
19361943 TimeseriesMetadata valueTimeSeriesMetadata = valueTimeseriesMetadataList .get (i );
19371944 if (valueTimeSeriesMetadata != null
19381945 && !getTsDataTypeList ()
19391946 .get (i )
19401947 .isCompatible (valueTimeSeriesMetadata .getTsDataType ())) {
19411948 valueTimeseriesMetadataList .set (i , null );
1942- incompactibleCount ++;
19431949 }
19441950 }
1945- return incompactibleCount != getTsDataTypeList ().size ();
19461951 }
19471952 return true ;
19481953 }
0 commit comments