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: add support for milliseconds in time window interval #78

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## 1.2.4
## 1.2.5

- Fix: Add support for milliseconds in time window interval

---

### 1.2.4

- Chore: Upgrade go & npm dependencies to latest versions
- Refactor: SetConnMaxIdleTime to 6 hours on Databricks Connection Refresh
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mullerpeter-databricks-datasource",
"private": true,
"version": "1.2.4",
"version": "1.2.5",
"description": "Databricks SQL Connector",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
Expand Down
7 changes: 7 additions & 0 deletions pkg/plugin/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func getIntervalString(duration time.Duration) string {
hours := int(math.Floor(duration.Hours()))
minutes := int(math.Floor(duration.Minutes()))
seconds := int(math.Floor(duration.Seconds()))
milliseconds := int(duration.Milliseconds())

returnString := ""

Expand All @@ -35,6 +36,12 @@ func getIntervalString(duration time.Duration) string {
deliminator = " "
}

remainingMilliseconds := milliseconds - (seconds * 1000)
if remainingMilliseconds > 0 {
returnString = fmt.Sprintf("%s%s%d MILLISECONDS", returnString, deliminator, remainingMilliseconds)
deliminator = " "
}

return returnString
}

Expand Down
Loading