BTEQ DBS 返回的活动计数与返回的实际行数不匹配

发布于 2024-12-24 01:55:50 字数 889 浏览 0 评论 0原文

当我使用 BTEQ 从 teradata 导出表时,输出行计数与选择查询计数不匹配。以下是 BTEQ 显示的警告

Warning: The activity count returned by DBS does not match
              the actual number of rows returned.
              Activity Count=495294, Total Rows Returned=495286

这是选择查询,

SELECT CUST_ID, SPEC1_CODE FROM Table
GROUP BY 1,2

这是创建表脚本,

CREATE MULTISET TABLE Table ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT
     (
      RECORD_KEY DECIMAL(20,0) NOT NULL,
      CUST_ID VARCHAR(40) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      SPEC1_CODE VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( RECORD_KEY );

当我们联系 Teradata 支持时,他们要求我们运行以下查询。

DIAGNOSTIC NOAGGRENH ON FOR SESSION;

因此,如果我们运行上面的查询,然后运行 ​​select/BTEQ 导出,它就可以正常工作。

When I am exporting a table from teradata using BTEQ, the output row count does not match the select query count. The following is the warning shown by BTEQ

Warning: The activity count returned by DBS does not match
              the actual number of rows returned.
              Activity Count=495294, Total Rows Returned=495286

Here is the select query,

SELECT CUST_ID, SPEC1_CODE FROM Table
GROUP BY 1,2

Here is the create table script,

CREATE MULTISET TABLE Table ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT
     (
      RECORD_KEY DECIMAL(20,0) NOT NULL,
      CUST_ID VARCHAR(40) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
      SPEC1_CODE VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( RECORD_KEY );

When we contacted Teradata support, they asked us to run the following query.

DIAGNOSTIC NOAGGRENH ON FOR SESSION;

So, if we run the above query and then run our select/BTEQ export, it is working fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山人契 2024-12-31 01:55:50

我希望您能早点回答我在评论中的问题,但我将把它作为您在警告消息中看到的差异的可能原因。

您的表被定义为具有非唯一主索引的 MULTISET,或者可能被定义为 Teradata 13.x 中的 NOPI 表。表或唯一索引没有额外的唯一约束。该表已加载 8 个重复的数据行。

由于我无法根据您的描述查明原因,BTEQ 返回了一组唯一的记录,尽管优化器表明该语句的活动计数更大。因此您看到的是警告消息。

I was hoping you would answer my questions in the comment sooner but I'm going to throw this out as a possible reason for the discrepancy you are seeing in the warning message.

Your table is defined as MULTISET with a non-unique primary index or possibly as a NOPI table in Teradata 13.x. There are no additional unique constraints on the table or unique indexes. The table has been loaded with 8 duplicate rows of data.

For reasons that I can not pinpoint based on your description BTEQ returned a unique set of records although the optimizer indicates that the activity count for the statement was greater. Thus the warning message that you are seeing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文