MSSQL connector fails to preview or import tables containing a `TIMESTAMP`/`ROWVERSION` column

オープン
#473 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, sql
領域
databases

調査の方向性

Locate the MSSQL connector code that generates SELECT queries for table preview and import. The error shows the connector implicitly converts TIMESTAMP/ROWVERSION to nvarchar(max), which SQL Server forbids. Modify the query generation to handle this data type—cast to VARBINARY or skip the conversion. Test with the reproduction table to confirm the fix.

索引モデルが issue の本文から書いたものです。

説明

Environment
  • Microsoft Data Formulator running in Docker
  • Ubuntu Server 24.04
  • Microsoft SQL Server 2022
  • MSSQL Python driver (mssql_python, as shown in the application log)
Description

When I try to preview or import a SQL Server table that contains a TIMESTAMP column, the operation fails. In SQL Server, TIMESTAMP is a synonym for ROWVERSION—it stores a binary row version, not a date or time.

Minimal reproduction
CREATE TABLE dbo.Repro (
    Id int NOT NULL PRIMARY KEY,
    RowVersionColumn timestamp NOT NULL,
    SysStartTime datetime2(7) GENERATED ALWAYS AS ROW START NOT NULL,
    SysEndTime datetime2(7) GENERATED ALWAYS AS ROW END NOT NULL,
    PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime)
)
WITH (
    SYSTEM_VERSIONING = ON (
        HISTORY_TABLE = dbo.ReproHistory
    )
);
  1. Connect Data Formulator to the SQL Server database.
  2. Select dbo.Repro.
  3. Try to preview or import the table.
Expected behavior

The table should be previewed and imported successfully, with the ROWVERSION column handled as binary data or otherwise handled safely.

Actual behavior

Both preview and import fail with a data-load error. The SQL Server driver reports:

Invalid character value for cast specification;
[Microsoft][SQL Server] Explicit conversion of the timestamp data type
to nvarchar(max) is not allowed.

The error occurs while executing the generated SELECT query.

主要言語
Python
スター
17.7k
フォーク
1.7k
平均マージ
4日 1時間
マージ済み PR(30日)
8

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/data-formulator のほかの issue

microsoft/data-formulator の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。