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

How to define the time column in the inline datasource? #11281

Open
avalanchy opened this issue May 21, 2021 · 1 comment
Open

How to define the time column in the inline datasource? #11281

avalanchy opened this issue May 21, 2021 · 1 comment

Comments

@avalanchy
Copy link

The only example I found for inline datasource is in the querying datasource page, but it does not contain a time column https://druid.apache.org/docs/latest/querying/datasource.html#inline.

I tried to use __time name with a timestamp, millisecond precision timestamp, or ISO8601 but without luck, at least for no timeBoundary query.

{
  "dataSource": {
    "columnNames": [
      "__time",
      "val"
    ],
    "rows": [
      [
        1556668800000,
        123
      ],
      [
        1559347200000,
        456
      ],
      [
        1561939200000,
        789
      ]
    ],
    "type": "inline"
  },
  "queryType": "timeBoundary"
}

Actual results

maxTime minTime
146140482-04-24T15:36:27.902Z -146136543-09-08T08:23:32.096Z

Expected results

maxTime minTime
2019-07-01T00:00:00.000Z 2019-05-01T00:00:00.000Z
@avalanchy
Copy link
Author

avalanchy commented Jan 25, 2023

I have this workaround. This is not documented (docs for 24.0.2) but adding "intervals": ["0000/3000"] makes it work.

{
  "dataSource": {
    "columnNames": [
      "__time",
      "val"
    ],
    "rows": [
      [
        1556668800000,
        123
      ],
      [
        1559347200000,
        456
      ],
      [
        1561939200000,
        789
      ]
    ],
    "type": "inline"
  },
  "queryType": "timeBoundary",
  "intervals": ["0000/3000"]
}
maxTime minTime
2019-07-01T00:00:00.000Z 2019-05-01T00:00:00.000Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants