CREATE-FILE
Last Updated:2021-04-13
CREATE FILE
Description
This statement is used to create and upload a file to Palo cluster.
This function is often used to manage files that are required in other commands, such as certificates, public keys and private keys, etc.
CREATE FILE "file_name" [IN database]
[properties]
file_name
:custom file name.database
:the file belongs to a certain database. If the database is not specified, then use the current database.-
properties
supports the following parameters:url
:required. The download path of files must be specified. Currently, it only supports unauthenticated http download paths. After the command is successfully executed, the file will be saved in Palo, and the url will no longer be needed.catalog
:required. The classification name of the file can be customized. But in some commands, it will need to search the files in specified catalog. For example, in routine import, when the data source is kafka, it will need to search files in the catalog of kafka.md5
: optional. md5 of files. If specified, it will be verified after the file is downloaded.
Example
-
Create file ca.pem and classify it as kafka
CREATE FILE "ca.pem" PROPERTIES ( "url" = "https://test.bj.bcebos.com/kafka-key/ca.pem", "catalog" = "kafka" );
-
Create file client.key and classify as itmy_catalog
CREATE FILE "client.key" IN my_database PROPERTIES ( "url" = "https://test.bj.bcebos.com/kafka-key/client.key", "catalog" = "my_catalog", "md5" = "b5bb901bf10f99205b39a46ac3557dd9" );
Keywords
CREATE, FILE
Best Practices
- Only users with amdin privilege can execute this command. For files belonging to a database, they can be used by users who have access to the database.
-
Limits on file size and quantity.
This function is mainly used to manage small files such as certificates. Therefore, the size of a single file is limited to 1MB. A Palo cluster can upload up to 100 files.