ajantha-bhat commented on a change in pull request #3437: [CARBONDATA-3530] Support Create timeseries MV Datamap with the supported granularity levels.
URL:
https://github.com/apache/carbondata/pull/3437#discussion_r346141262
##########
File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVHelper.scala
##########
@@ -152,6 +176,33 @@ object MVHelper {
fields,
fieldRelationMap,
tableProperties)
+ if (timeSeriesFunction != null) {
+ if (null != mainTable && (parentTablesList.size() == 1)) {
+ if (!mainTable.getTableName.equalsIgnoreCase(parentTablesList.get(0).getTableName)) {
+ throw new MalformedCarbonCommandException(
+ "Parent table name is different in Create and Select Statement")
+ }
+ }
+ val timeSeriesDataType = parentTablesList
+ .get(0)
+ .getTableInfo
+ .getFactTable
+ .getListOfColumns
+ .asScala
+ .filter(columnSchema => columnSchema.getColumnName
+ .equalsIgnoreCase(timeSeriesColumn))
+ .head
+ .getDataType
+ if (timeSeriesDataType.equals(DataTypes.DATE) ||
+ timeSeriesDataType.equals(DataTypes.TIMESTAMP)) {
+ if (timeSeriesDataType.equals(DataTypes.DATE)) {
+ TimeSeriesUtil.validateTimeSeriesGranularityForDate(timeSeriesFunction)
+ }
Review comment:
No granularity validation for timestamp ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services