Amazon Redshift Error - ERROR: 0A000: Specified types or functions (one per INFO message) not supported on Redshift tables

Amazon Redshift Error - ERROR: 0A000: Specified types or functions (one per INFO message) not supported on Redshift tables

当 运行 执行以下查询时:

WITH sublevels AS (
SELECT 1 UNION ALL 
SELECT 1 UNION ALL
SELECT 1), FIELDA AS (SELECT (ROW_NUMBER() OVER ())::INT sublevel 
FROM sublevels sl1, sublevels sl2, sublevels sl3)
SELECT TOP 10 
FIELDB, 
sublevel, REPLACE(REGEXP_REPLACE(REGEXP_SUBSTR(UPPER(FIELDC), 'FROM \S+', 1, sublevel), 'FROM ', ''),')','') ALIASA
FROM TABLEA
JOIN FIELDA ON sublevel <= REGEXP_COUNT(UPPER(FIELDC), 'FROM ')
WHERE ALIASA != 'ABC'
AND lower(split_part(ALIASA, '.', 2)) IN (
SELECT DISTINCT lower(t.table_name)
FROM information_schema.tables t
INNER JOIN information_schema.columns c on c.table_name = t.table_name AND c.table_schema = t.table_schema
WHERE lower(column_name) similar TO '%(aaa|bbb|ccc)%')

我收到以下错误:

ERROR: 0A000: Specified types or functions (one per INFO message) not supported on Redshift tables.

我不知道为什么,如果我 运行 单独查询它们就可以正常工作:

查询 1

WITH sublevels AS (
SELECT 1 UNION ALL 
SELECT 1 UNION ALL
SELECT 1), FIELDA AS (SELECT (ROW_NUMBER() OVER ())::INT sublevel 
FROM sublevels sl1, sublevels sl2, sublevels sl3)
SELECT TOP 10 
FIELDB, 
sublevel, REPLACE(REGEXP_REPLACE(REGEXP_SUBSTR(UPPER(FIELDC), 'FROM \S+', 1, sublevel), 'FROM ', ''),')','') ALIASA
FROM TABLEA
JOIN FIELDA ON sublevel <= REGEXP_COUNT(UPPER(FIELDC), 'FROM ')
WHERE ALIASA != 'ABC'

查询2

SELECT DISTINCT lower(t.table_name)
FROM information_schema.tables t
INNER JOIN information_schema.columns c on c.table_name = t.table_name AND c.table_schema = t.table_schema
WHERE lower(column_name) similar TO '%(aaa|bbb|ccc)%'

在 Redshift 中:

  1. 仅在领导节点上针对 information_schema 运行 的查询
  2. 仅对计算节点上的任何 "normal" 表 运行 进行查询

不能混合搭配 1. 和 2.