infiniflow/ragflow · error · ConnectorValidationError

BigQuery timestamp column type '{field_type}' is not support

Error message

BigQuery timestamp column type '{field_type}' is not supported as a cursor.

What it means

Raised when the timestamp column exists but its BigQuery field type is not in _CURSOR_PARAM_TYPE_MAP, so the connector cannot bind it as a typed ScalarQueryParameter for cursor filtering.

Source

Thrown at common/data_source/bigquery_connector.py:259

            return dry_run_job.schema or []

    def _get_cursor_column_field_type(self) -> str:
        """Resolve the BigQuery field type of the timestamp column."""
        client = self._get_client()
        schema = self._resolve_schema(client)

        for field in schema:
            if field.name == self.timestamp_column:
                return field.field_type
        raise ConnectorValidationError(f"BigQuery timestamp column '{self.timestamp_column}' was not found in the schema.")

    def _resolve_cursor_param_type(self) -> str:
        if self._cursor_param_type is not None:
            return self._cursor_param_type
        field_type = (self._get_cursor_column_field_type() or "").upper()
        param_type = _CURSOR_PARAM_TYPE_MAP.get(field_type)
        if param_type is None:
            raise ConnectorValidationError(f"BigQuery timestamp column type '{field_type}' is not supported as a cursor.")
        self._cursor_param_type = param_type
        return param_type

    def _make_cursor_param(self, name: str, value: Any, param_type: str):
        return bigquery.ScalarQueryParameter(name, param_type, value)

    def _build_time_filtered_query(
        self,
        base_query: str,
        start: Any = None,
        end: Any = None,
        start_id: Any = None,
    ) -> Tuple[str, List[Any]]:
        wrapped = self._wrap_query(base_query)
        if not self.timestamp_column or (start is None and end is None):
            return wrapped, []

        param_type = self._resolve_cursor_param_type()

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Point timestamp_column at a real TIMESTAMP/DATETIME/DATE column
  2. Or CAST the column in a custom query: SELECT CAST(ts AS TIMESTAMP) AS ts ...
  3. If the column is genuinely unsupported, remove timestamp_column and use id_column-based cursoring or full sync

Example fix

// before
config = {"timestamp_column": "ts_str", ...}  # STRING column

// after
config = {"query": "SELECT *, CAST(ts_str AS TIMESTAMP) AS ts FROM `p.d.t`", "timestamp_column": "ts", ...}
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {"TIMESTAMP", "DATETIME", "DATE", "INT64"}
sql = "SELECT data_type FROM region-us.INFORMATION_SCHEMA.COLUMNS WHERE ..."
ft = client.query(sql).result()  # fetch type of timestamp_column
if ft.upper() not in SUPPORTED:
    raise ValueError(f"{ft} not usable as cursor; cast in query or pick another column")

Try / catch

try:
    conn.validate_connector_settings()
except ConnectorValidationError as e:
    if "not supported as a cursor" in str(e):
        switch_to_cast_query_or_id_cursor()
    else:
        raise

Prevention

When it happens

Trigger: timestamp_column pointing at a STRING, BOOL, FLOAT, or RECORD/STRUCT column; only types mapped in _CURSOR_PARAM_TYPE_MAP (typically TIMESTAMP/DATETIME/DATE and numeric ids like INT64) are accepted.

Common situations: Timestamps stored as ISO strings; using a FLOAT 'epoch seconds' column as cursor; struct-typed columns.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/10680dd844675890. Report an issue: GitHub.