Redshift__在一個外部架構下建立外部表後,其他外部架構也自動生成了一樣的外部表
官方檔案
Amazon Redshift 外部 schema 引用了外部資料目錄中的外部資料庫。您可在 Amazon Redshift、Amazon Athena、AWS Glue Data Catalog 或在 Apache Hive 元儲存(如 Amazon EMR)中建立外部資料庫。
只有建立external schema時使用不同的database,則在這些不同的external schema下建立一個外部表,其他的external schema不會自動出現生成相同的外部表,也就是說,其實external table外部表是和external database對應的,同一個external database下所有的external schema有相同的external table
create external schema spectrum_schema from data catalog
database 'spectrum_db'
iam_role 'arn:aws:iam::123456789012:role/MySpectrumRole'
create external database if not exists;
官方技術支援的回覆
Dear Customer,
Warm greetings from AWS Support Engineering. I hope you are doing well. Thank you for reaching out to us with your concern. My name is Gurpreet and I will be helping you with your case.
From the case notes and our discussion, I could understand that you found an issue where, when user creates or drops an external table under specific external schema (like spectrum), then other external schema will also generate or lose the same table. Please correct me if I misunderstood your concern in any way.
In this context, I would like to inform you that I have tested a similar scenario at my test environment and was able to replicate the similar scenario at my end. Please find below the quick summary steps:
1. Created 2 external schemas over the same Athena database - spectrum_schema_1 & spectrum_schema_2
2. Created an external table in spectrum_schema_1 and it was created in both the external schemas:
dev=# create external table spectrum_schema_1.newtbl(id int, doj varchar) location 's3://<test-buck>/f1';
CREATE EXTERNAL TABLE
dev=# select redshift_database_name, schemaname, tablename, location from svv_external_tables where tablename='newtbl';
redshift_database_name | schemaname | tablename | location
------------------------+-------------------+-----------+--------------------
dev | spectrum_schema_1 | newtbl | s3://<test-buck>/f1
dev | spectrum_schema_2 | newtbl | s3://<test-buck>/f1
(2 rows)
2. Dropped the external table from spectrum_schema_1 and it was dropped from both the external schemas:
dev=# drop table spectrum_schema_1.newtbl;
DROP TABLE
dev=# select redshift_database_name, schemaname, tablename, location from svv_external_tables where tablename='newtbl';
redshift_database_name | schemaname | tablename | location
------------------------+------------+-----------+----------
(0 rows)
===================
However, the above behavior is not observed if the external schemas are created over two different Athena databases. Please find below the quick summary steps:
1. Created another external schema over a different Athena database - spectrum_schema_3.
2. Created an external table in spectrum_schema_3 and it is only created in one external schema (i.e. - spectrum_schema_3):
dev=# select redshift_database_name, schemaname, tablename, location from svv_external_tables where tablename='newtbl';
redshift_database_name | schemaname | tablename | location
------------------------+-------------------+-----------+--------------------
dev | spectrum_schema_3 | newtbl | s3://<test-audit-logs>/f1/logs
(1 row)
Therefore, from the above replications it can be inferred that in case the external schemas over the same database and we create a table in one of the external schema then it is created in other external schemas as well because the external table is being created at the Athena database from where other schemas are fetching/reading the data.
However, in case the external schemas created over the different Athena databases, it doesn’t exhibit the above behavior because the external table is being created in the Athena database which is not scanned by other external schema. So, I would like to inform you that the behavior being observed is expected.
With that said, in case you have any other queries/concerns related to this issue. I would be happy to hop on a call to discuss this further. And, I request you to please provide your available time slots (Preferably 2-3 time slots) along with timezone so that we can schedule a call at your convenience.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2947503/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Redshift建立外部架構external schema和外部表external table架構
- Oracle 外部表Oracle
- fdw批次匯入外部表
- Clickhouse的MySQL外部表,坑貨!MySql
- Script載入順序 & 外部樣式表的阻塞
- Postgresql外部表使用 postgres_fdwSQL
- 刪除外部表時遇到的坑
- Hive內部表和外部表的區別Hive
- 外部排序排序
- 引入外部字型
- GEDIT外部工具
- 外部插入.after()
- 如何連線一個像 MSSQL 或者 orcale 一樣的外部資料庫SQL資料庫
- x86架構中的外部中斷結構-Part 1:中斷控制器的演化架構
- 《微服務架構設計模式》讀書筆記 | 第8章 外部API模式微服務架構設計模式筆記API
- 外部函式的呼叫函式
- Android 外部儲存Android
- SpringBoot外部化配置Spring Boot
- SpringBoot使用外部tomcatSpring BootTomcat
- 外部儲存器
- hive學習筆記之三:內部表和外部表Hive筆記
- 在容器外部連線kafka失敗Kafka
- Springboot整合外部Tomcat配置Spring BootTomcat
- SpringBoot中配置外部TomcatSpring BootTomcat
- SpringBoot 之配置外部TomcatSpring BootTomcat
- EXTI-外部中斷
- Maven 引入外部依賴Maven
- Java_操作外部程式Java
- PHP 原始碼探祕 - 在解析外部變數時的一個問題PHP原始碼變數
- PHP 原始碼探祕 – 在解析外部變數時的一個問題PHP原始碼變數
- 【oracle 多種形式的外部表匯入、匯出】實驗Oracle
- PLC結構化文字(ST)——結構體屬性外部呼叫(Issue)結構體
- 使用springboot建立web專案,並使用外部TomcatSpring BootWebTomcat
- SpringBoot的外部化配置最全解析!Spring Boot
- 建設外部連結的方法
- 從外部獲取一個django專案的所有model名稱Django
- SparkSQL外部資料來源SparkSQL
- 內部類與外部類