BTEQ DBS 返回的活动计数与返回的实际行数不匹配
当我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望您能早点回答我在评论中的问题,但我将把它作为您在警告消息中看到的差异的可能原因。
您的表被定义为具有非唯一主索引的 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.