翻译:Snowflake Architecture: The Snowflake architecture has three main layers, namely the Database Storage Layer for storing data, the Compute Layer for performing query and data processing tasks, and the Cloud Services Layer for managing metadata, query parsing, optimization, and user authentication. A virtual warehouse is a cluster of compute resources that executes queries and can scale up or down as needed.
翻译:Data Loading and Unloading: The COPY INTO command is used to load data from external files into Snowflake tables. Snowflake has an internal stage (for temporarily storing data files) and an external stage (located in external cloud storage services).
翻译:Data Sharing: Snowflake’s Data Sharing feature enables secure sharing of data between accounts without physically copying or moving data. Recipients can query the shared data directly, and a Secure Data Share ensures access control and encryption during transit.
翻译:Security and Authentication: Snowflake supports authentication methods such as username and password, Single Sign-On, External OAuth, and Multi-factor Authentication. Role-based access control (RBAC) is used to define and manage user access to data and resources.
翻译:Performance Optimization: Clustering keys are used to define the physical arrangement of data in a table to improve query performance. There are two methods: automatic clustering and manual clustering.
Snowflake SQL
知识点:UPPER()函数将字符串转为大写;COUNT()函数用于计算表的行数。
翻译:Snowflake SQL: The UPPER() function converts a string to uppercase, and the COUNT() function is used to count the number of rows in a table.
翻译:Time Travel and Fail-safe: Time Travel allows you to query, clone, or restore data from a previous state, with a maximum retention period of 90 days. Fail-safe is a last-resort data recovery mechanism with a 7-day recovery period, but the data is not user-accessible for querying.
翻译:Snowflake Marketplace: The Snowflake Marketplace is a platform where users can find and access third-party data, applications, and services. Data can be purchased or shared and immediately queried within the Snowflake environment.
Snowflake数据类型
知识点:Snowflake支持VARIANT、OBJECT、ARRAY等半结构化数据类型。
翻译:Snowflake Data Types: Snowflake supports semi-structured data types such as VARIANT, OBJECT, and ARRAY.
Snowflake克隆
知识点:克隆可创建数据库、模式、表的副本,不复制底层数据,克隆对象可独立修改。
翻译:Snowflake Cloning: Cloning allows you to create copies of databases, schemas, or tables without duplicating the underlying data. Cloned objects can be modified independently.
翻译:Additional Information about Virtual Warehouses: When a virtual warehouse is suspended, the running queries are automatically paused and no new queries can be submitted. When scaling a virtual warehouse, the running queries are not disrupted, and only new queries are affected.
翻译:Additional Information about Data Storage and Management: Micro-partitioning organizes data into small, optimized partitions based on data characteristics. Snowflake has stage types like internal stage and external stage, but there is no such type as external file stage.
Snowflake SQL与查询补充
知识点:用CREATE TABLE AS SELECT * FROM ;语法从查询结果创建表;DROP TABLE ;用于删除表。
翻译:Additional Information about Snowflake SQL and Querying: Use the syntax CREATE TABLE AS SELECT * FROM to create a table from a query result. DROP TABLE is used to delete a table.
安全与访问控制补充
知识点:角色授予用户时默认无权限,需显式授予;SELECT权限可在对象级别授予。
翻译:Additional Information about Security and Access Control: By default, a role has no permissions when granted to a user and needs to be explicitly granted. The SELECT privilege can be granted at the object level.
性能调优补充
知识点:对频繁过滤的列使用clustering key、合适场景用物化视图能提升性能。
翻译:Additional Information about Performance Tuning: Using clustering keys for frequently filtered columns and materialized views in appropriate scenarios can improve performance.
Time Travel与数据恢复补充
知识点:Time Travel最长保留90天;Fail-safe用于防止数据意外删除或损坏丢失。
翻译:Additional Information about Time Travel and Data Recovery: Time Travel can retain data for up to 90 days. Fail-safe is used to prevent data loss in case of accidental deletion or corruption.
翻译:Additional Information about Data Sharing and Marketplace: Data sharing doesn’t require copying data. The ACCOUNTADMIN role can perform actions such as creating and managing virtual warehouses, querying data, and modifying user roles and access privileges.
Snowflake使用与最佳实践补充
知识点:临时表在会话结束时自动删除;Snowflake通过分配虚拟仓库处理并发查询。
翻译:Additional Information about Snowflake Usage and Best Practices: Temporary tables are automatically dropped at the end of the session. Snowflake handles concurrent queries by allocating virtual warehouses.
翻译:Additional Information about Semi-Structured Data Handling: The VARIANT data type is used to store semi-structured data, with the advantage of storing structured, semi-structured, and unstructured data in a single column. The ARRAY data type is used to store lists in semi-structured data.
数据治理补充
知识点:访问历史用于维护数据沿袭与审计。
翻译:Additional Information about Data Governance: Access History is used to maintain data lineage and auditing.
翻译:Additional Information about Data Loading and Unloading: Loading data from an external stage does not support the Excel format. Use the COPY INTO command to unload data from a table to an external storage.
翻译:Additional Information about Snowflake Roles and Access Control: The SECURITYADMIN privilege is required to create a new user. The CREATE TABLE privilege is granted at the schema level, not the database level.
翻译:Additional Information about Snowflake Performance Optimization: Clustering keys have many performance benefits and do not increase storage costs. Automatic clustering is most beneficial for queries with range-based filtering on large datasets.
数据共享补充
知识点:数据共享中消费者接收数据副本用于查询不能修改;可共享数据库 。
翻译:Additional Information about Data Sharing: In data sharing, the consumer receives a copy of the data for querying and cannot modify it. Databases can be shared.
翻译:Snowflake Monitoring and Management: Query Profile, Query History, and Information Schema Views can be used to monitor query performance and optimize it.