import
Writes all input records to the specified table. Requires cluster administrator privileges.
Command properties
| Property | Value |
|---|---|
| Command type | Transforming |
| Required permission | Cluster administrator |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Runs on Control Node (reducer) |
Syntax
Options
create=BOOL- When set to
t, automatically creates the target table if it does not exist. This option is only available when the system propertyaraqne.logdb.import_create_optionis enabled. (Default:f) _sk=STR- Field name for the partition subkey. Specifies the field from which to read the subkey value used to determine the partition when saving records. (Default:
_sk)
Target
TABLE- Name of the target table to write records to.
Input fields
| Field | Type | Required | Description |
|---|---|---|---|
_time | timestamp | Optional | Record timestamp. If the value is null or not a timestamp type, the current time is used. |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 30100 | 권한이 없습니다. 클러스터 관리자 권한이 필요합니다. | Executed without cluster administrator privileges |
| 30101 | [table]은 존재하지 않는 테이블입니다. | The specified table does not exist and the create option was not used |
| 30102 | [table]은 잘못된 형식의 테이블 이름입니다. | The table name is invalid |
| 30103 | import 명령어에서 create 옵션은 더 이상 지원되지 않습니다. | create=t was specified but the system property is disabled |
Runtime errors
N/A
Description
The import command writes all input records to the specified table and passes the input records unchanged to the next command. It uses the _time field value as the storage timestamp. If the _time field is missing or not a timestamp type, the current time is used.
If the storage is in read-only mode or a write error occurs, the query is cancelled.
In a distributed environment, this command runs on the Control Node.
Examples
-
Write records to a table
table duration=1h web_logs | import web_logs_backupQueries the last 1 hour of data from the
web_logstable and writes it to theweb_logs_backuptable. -
Save aggregated results to a table
table duration=1d web_logs | stats count by method | import method_statsAggregates 1 day of data from the
web_logstable by HTTP method and saves it to themethod_statstable. -
Specify the partition subkey field
table duration=1h web_logs | import _sk=host web_logs_partitionedUses the value of the
hostfield as the partition subkey and writes records to theweb_logs_partitionedtable.