您好我是wx2的新手,无法获得适当的文档。
我需要了解我们可以传递给wxloader实用程序的参数是什么?
即-b
和-f
在下面的命令中引用了什么?
wxloader -z Server_Ip -u User_name -p password -b /test/.test.err -f '|' --blank-null --trim-varchars -t "$TABLENAME" /path_to_file
另外,为什么我们在'|'
之后使用-f
?
答案 0 :(得分:0)
根据Kognitio文档(命令行工具)
Usage: wxloader -s <dsn> -u <user> -t <table> <filename>
转化选项:
-F, --field-format-file <file> File containing field format string
-w, --wcb-file Load WCB file
-D, --date-format <fmt> Format of dates [YYYY-MM-DD]
-S, --timestamp-format <fmt> Format of timestamps [YYYY-MM-DD HH:NN:SS]
-T, --time-format <fmt> Format of times [HH:NN:SS]
--implied-dp DECIMAL fields have implied decimal points
--min-year <year> Two-digit years are no earlier than <year>
--null-value <str> String to be translated to NULL
-N, --naive-delimiting Quotes have no special meaning
-f, --field-separator <char> Field separator character [,]
--long-field-separator <str> Field separator string
--load-no-nulls Use zero or blank for all blank fields
--separator-terminated-values Expect a field separator after last field
--pad-short-records Use NULL for missing trailing fields
--truncate-strings Silently truncate overlong strings
--trim-varchars Remove trailing spaces from VARCHAR fields
--preserve-leading-spaces Don't trim leading spaces from fields
--truncate-long-records Ignore excess fields in a record
--blank-null Blank strings are always NULL
--exclude-fields 1,2,3,... List of field numbers to exclude
--currency-symbol <char> Ignore this symbol before numeric fields
--decimal-point <char> Decimal point character if not '.'
--thousand-separator <char> Thousand separator character if not ','
--quote <char> Character to quote strings if not "
--char-for-unknown <char> Character to use for unimportable chars
--int-allow-decimals Round non-int values for int columns
如果使用-F给出格式字符串,它将覆盖所有字段转换选项。 如果给出-w,则忽略字段转换选项。
记录级转化选项:
--record-terminator <char> Record terminator character [\n]
--record-type <type> Type of record, default auto
Valid record types are:
term terminated by record terminator, no quoted strings
qterm terminated by record terminator, quotes surround strings
fixed fixed-width records, must specify --record-width
auto discern record type from format string/column types
--record-width <width> Size of fixed-width record in characters
文件级转换选项:
-c, --character-set <charset> Character set of input file
--file-start-offset <n> Skip <n> bytes at start of file
--skip-records <n> Skip <n> records at start of file
--max-records <n> Load no more than <n> records
报告选项:
-v, --verbose More commentary
-q, --quiet Less commentary
-b, --bad-records-file <file> Destination for rejected records
--log-file <file> Output to file
--max-conversion-errors <n> Stop on more than <n> conversion errors
-P, --show-progress Show progress indicator (default)
--no-progress No progress indicator (default if -q)
--progress-interval-records n Update progress count every <n> records
--progress-interval-bytes n Update progress count every <n> bytes
--progress-interval-seconds n Update progress count every <n> seconds
--show-timings Show timing information
行为选项:
-t, --table <name> Destination table [required]
-d, --truncate-table Truncate table before import
--no-statistics Don't update table statistics after import
--use-checksums Use checksums on data blocks
--no-checksums Don't use checksums (default)
在你的情况下,
wxloader -z Server_Ip -u User_name -p password -b /test/.test.err -f '|' --blank-null --trim-varchars -t "$TABLENAME" /path_to_file
您尝试连接到服务器abd,将表导出到管道分隔文件中。
-f
用于字段分隔符,|
只是实际字段分隔字符串