Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1055 #1056

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,23 @@ private[offline] class AnchorToDataSourceMapper(dataPathHandlers: List[DataPathH

val dataLoaderHandlers: List[DataLoaderHandler] = dataPathHandlers.map(_.dataLoaderHandler)

// Only file-based source has real "path", others are just single dataset
val (adjustedObsTimeRange, dataSourcePath) = if (factDataSource.location.isFileBasedLocation()) {
val (timeInterval, updatedFactDataSource) = if (factDataSource.location.isFileBasedLocation()) {
val pathChecker = PathChecker(ss, dataLoaderHandlers)
val pathAnalyzer = new TimeBasedHdfsPathAnalyzer(pathChecker, dataLoaderHandlers)
val pathInfo = pathAnalyzer.analyze(factDataSource.path)
if (pathInfo.dateTimeResolution == DateTimeResolution.DAILY) {
(obsTimeRange.adjustWithDateTimeResolution(DateTimeResolution.DAILY), pathInfo.basePath)
} else (obsTimeRange, pathInfo.basePath)
val adjustedObsTimeRange = if (pathInfo.dateTimeResolution == DateTimeResolution.DAILY) {
obsTimeRange.adjustWithDateTimeResolution(DateTimeResolution.DAILY)
} else {
obsTimeRange
}
(OfflineDateTimeUtils.getFactDataTimeRange(adjustedObsTimeRange, window, timeDelays),
DataSource(pathInfo.basePath, factDataSource.sourceType, factDataSource.timeWindowParams,
factDataSource.timePartitionPattern, factDataSource.postfixPath))
} else {
(obsTimeRange, factDataSource.path)
// Path and time range adjustments cannot be applied to non-file-based sources, keep them as-is
(obsTimeRange, factDataSource)
}
// Copy the pathInfo's path into the datasource path as it adds the daily/hourly keyword if it is missing from the path
val updatedFactDataSource = DataSource(dataSourcePath, factDataSource.sourceType, factDataSource.timeWindowParams,
factDataSource.timePartitionPattern, factDataSource.postfixPath)

val timeInterval = OfflineDateTimeUtils.getFactDataTimeRange(adjustedObsTimeRange, window, timeDelays)
val needCreateTimestampColumn = SlidingWindowFeatureUtils.needCreateTimestampColumnFromPartition(factDataSource)
val shouldSkipFeature = FeathrUtils.getFeathrJobParam(ss.sparkContext.getConf, FeathrUtils.SKIP_MISSING_FEATURE).toBoolean

Expand Down