got "Failed to get shardSpec for interval" error for period segmentGranularity with timeZone

12 views
Skip to first unread message

Alex

unread,
Apr 17, 2024, 12:44:42 PMApr 17
to Druid User
Hi All,

When using the segmentGranularity parameter with the "type": "period" for the ingestion specification with hashed partitionsSpec, I encountered an exception:
org.apache.druid.java.util.common.ISE: Failed to get shardSpec for interval[2023-12-30T22:00:00.000Z/2023-12-31T22:00:00.000Z]
at org.apache.druid.indexing.common.task.ShardSpecs.getShardSpec(ShardSpecs.java:57) ~[druid-indexing-service-29.0.1.jar:29.0.1]
at org.apache.druid.indexing.common.task.NonLinearlyPartitionedSequenceNameFunction.getSequenceName(NonLinearlyPartitionedSequenceNameFunction.java:49) ~[druid-indexing-service-29.0.1.jar:29.0.1]


Changing "segmentGranularity" to day (simple UTC day without timezone) resolved the error. However, I'm unsure whether I made an error in my configuration or if this is a Druid bug?
Maybe someone can advise a workaround to avoid this error?

Here's a simplified ingestion specification to reproduce the issue:
{
  "type": "index_parallel",
  "spec": {
    "ioConfig": {
      "type": "index_parallel",
      "inputSource": {
        "type": "inline",
        "data": "datetime;field1int;field2string\n31.12.2023 12:34:56;220;simple string\n31.12.2023 12:34:57;330;string2"
      },
      "inputFormat": {
        "type": "tsv",
        "findColumnsFromHeader": true,
        "skipHeaderRows": 0,
        "delimiter": ";",
        "listDelimiter": "\u0001"
      },
      "appendToExisting": false
    },
    "tuningConfig": {
      "type": "index_parallel",
  "numShards": 10,
  "partitionsSpec": {
        "type": "hashed",
        "numShards": 10,
        "partitionDimensions": [
          "field1int"
        ],
        "partitionFunction": "murmur3_32_abs",
        "maxRowsPerSegment": null
      },
  "forceGuaranteedRollup": true,
      "logParseExceptions": true
    },
    "dataSchema": {
      "dataSource": "test_granularity2",
      "timestampSpec": {
        "column": "datetime",
        "format": "d.M.yyyy H:mm:ss"
      },
      "transformSpec": {},
      "dimensionsSpec": {
        "dimensions": [
          {
            "name": "field1int",
            "type": "long"
          },
          "field2string"
        ]
      },
      "granularitySpec": {
        "queryGranularity": "none",
        "rollup": false,
        "segmentGranularity": {
          "type": "period",
          "period": "P1D",
          "timeZone": "EET"
        }
      }
    }
  }
}

Reply all
Reply to author
Forward
0 new messages