Skip to content

[BUG] Hive 分区表导入时将 # Partition Information 误识别为字段,导致数据预览失败 #1250

Description

@szxiaoanda

SQLBot Version

v1.9.0 社区版

Run Mode

Docker container / Kubernetes 部署

Describe the bug

在 SQLBot 中导入 Hive 分区表后,表字段元数据解析异常。

系统疑似将 Hive 分区表元数据中的标题行 # Partition Information 误识别为了真实字段,导致后续点击数据预览时报错。

报错中可以看到,SQLBot 生成的预览 SQL 引用了 # Partition Information,但该字段并不是 Hive 表的真实字段,而是 Hive 分区表元数据中的说明标题。

错误信息如下:
Image

Additional context

初步判断可能是在解析 Hive 分区表结构时,使用了类似 DESCRIBE FORMATTED 或相关元数据结果,但没有过滤掉以 # 开头的说明行。

建议在 Hive 表字段解析逻辑中增加过滤规则:

忽略字段名为空的行;
忽略以 # 开头的元数据说明行;
对 Hive 分区表中的 # Partition Information、# col_name 等说明内容做特殊过滤;
仅保留真实字段和真实分区字段。

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions