Yasuhiro Horimoto 2019-01-30 12:15:21 +0900 (Wed, 30 Jan 2019) Revision: 4b091b86572bf39bbae913610db9a8735903216b https://github.com/groonga/groonga/commit/4b091b86572bf39bbae913610db9a8735903216b Message: doc: add explanations of "--load_table", "--load-columns" and "--load-values" Added files: doc/source/example/reference/commands/logical_select/load_table.log Modified files: doc/locale/ja/LC_MESSAGES/reference.po doc/source/reference/commands/logical_select.rst Modified: doc/locale/ja/LC_MESSAGES/reference.po (+72 -0) =================================================================== --- doc/locale/ja/LC_MESSAGES/reference.po 2019-01-29 10:19:11 +0900 (77ea5f835) +++ doc/locale/ja/LC_MESSAGES/reference.po 2019-01-30 12:15:21 +0900 (7221f45ee) @@ -8410,6 +8410,78 @@ msgstr "" "す。 ``post_filter`` を使うと ``filtered`` ステージの動的カラムを使って絞り込" "むことができます。他は :ref:`logical-select-filter` と同じです。" +msgid "``load_table``" +msgstr "````" + +msgid "" +"You can store specified a table a result of ``logical_select`` with ``--" +"load_table``, ``--load-columns`` and ``--load_values`` arguments. ``--" +"load_table`` specifies a table name for storing a result of " +"``logical_select``." +msgstr "" +"``--load_table`` 、 ``--load_columns`` 、 ``--load_values`` を使って、" +"``logical_select`` の結果を指定したテーブルに格納できます。 ``--load_table`` " +"は、``logical_select`` の結果を格納するテーブルの名前を指定します。" + +msgid "You must specify a table that already exists." +msgstr "既に存在するテーブルを指定する必要があります。" + +msgid "" +"This argument must use with :ref:`logical-select-load-columns` and :ref:" +"`logical-select-load-values`." +msgstr "" +"この引数は、 :ref:`logical-select-load-columns` と :ref:`logical-select-load-" +"values` と一緒に使う必要があります。" + +msgid "" +"Here is an example that can store ``_id`` and ``timestamp`` that a result of " +"``logical_select`` in a Logs table specified by ``--load_table``." +msgstr "" +"以下は、 ``--load_table`` で指定したLogsテーブルに ``logical_select`` の結果" +"である ``_id`` と ``timestamp`` を格納する例です。" + +msgid "``load_columns``" +msgstr "``load_columns``" + +msgid "" +"Specifies columns of a table that specifying ``--load-table``. Stores value " +"of columns that specified with :ref:`logical-select-load-values` in columns " +"that specified with this argument. You must specify columns that already " +"exists." +msgstr "" +"``--load_table`` で指定したテーブルのカラムを指定します。:ref:`logical-" +"select-load-values` で指定したカラムの値をこの引数で指定したカラムに格納しま" +"す。既に存在するカラムを指定する必要があります。" + +msgid "" +"This argument must use with :ref:`logical-select-load-table` and :ref:" +"`logical-select-load-values`." +msgstr "" +"この引数は、 :ref:`logical-select-load-table` と :ref:`logical-select-load-" +"values` と一緒に使う必要があります。" + +msgid "See example of ``--load_table`` for how to use this argument." +msgstr "この引数の使い方は、 ``--load_table`` の例を参照してください。" + +msgid "``load_values``" +msgstr "" + +msgid "" +"Specifies columns of result of ``logical_select``. Specifies columns for " +"storing values into columns that specified with :ref:`logical-select-load-" +"columns`. You must specify columns that already exists." +msgstr "" +"``logical_select`` の結果のカラムを指定します。 :ref:`logical-select-load-" +"columns` で指定したカラムに値を格納するカラムを指定します。既に存在するカラム" +"を指定する必要があります。" + +msgid "" +"This argument must use with :ref:`logical-select-load-table` and :ref:" +"`logical-select-load-columns`." +msgstr "" +"この引数は、 :ref:`logical-select-load-table` と :ref:`logical-select-load-" +"columns` と一緒に使う必要があります。" + msgid "Advanced search parameters" msgstr "高度な検索のための引数" Added: doc/source/example/reference/commands/logical_select/load_table.log (+129 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_select/load_table.log 2019-01-30 12:15:21 +0900 (6fb652ff1) @@ -0,0 +1,129 @@ +Execution example:: + + table_create Logs_20150203 TABLE_HASH_KEY ShortText + column_create Logs_20150203 timestamp COLUMN_SCALAR Time + table_create Logs_20150204 TABLE_HASH_KEY ShortText + column_create Logs_20150204 timestamp COLUMN_SCALAR Time + + table_create Logs TABLE_HASH_KEY ShortText + column_create Logs original_id COLUMN_SCALAR UInt32 + column_create Logs timestamp_text COLUMN_SCALAR ShortText + + load --table Logs_20150203 + [ + { + "_key": "2015-02-03:1", + "timestamp": "2015-02-03 10:49:00" + }, + { + "_key": "2015-02-03:2", + "timestamp": "2015-02-03 12:49:00" + } + ] + load --table Logs_20150204 + [ + { + "_key": "2015-02-04:1", + "timestamp": "2015-02-04 00:00:00" + } + ] + logical_select \ + --logical_table Logs \ + --shard_key timestamp \ + --load_table Logs \ + --load_columns "original_id, timestamp_text" \ + --load_values "_id, timestamp" + # [ + # [ + # 0, + # 0.0, + # 0.0 + # ], + # [ + # [ + # [ + # 3 + # ], + # [ + # [ + # "_id", + # "UInt32" + # ], + # [ + # "_key", + # "ShortText" + # ], + # [ + # "timestamp", + # "Time" + # ] + # ], + # [ + # 1, + # "2015-02-03:1", + # 1422928140.0 + # ], + # [ + # 2, + # "2015-02-03:2", + # 1422935340.0 + # ], + # [ + # 1, + # "2015-02-04:1", + # 1422975600.0 + # ] + # ] + # ] + # ] + select --table Logs + # [ + # [ + # 0, + # 0.0, + # 0.0 + # ], + # [ + # [ + # [ + # 3 + # ], + # [ + # [ + # "_id", + # "UInt32" + # ], + # [ + # "_key", + # "ShortText" + # ], + # [ + # "original_id", + # "UInt32" + # ], + # [ + # "timestamp_text", + # "ShortText" + # ] + # ], + # [ + # 1, + # "2015-02-03:1", + # 1, + # "1422928140000000" + # ], + # [ + # 2, + # "2015-02-03:2", + # 2, + # "1422935340000000" + # ], + # [ + # 3, + # "2015-02-04:1", + # 1, + # "1422975600000000" + # ] + # ] + # ] + # ] Modified: doc/source/reference/commands/logical_select.rst (+86 -0) =================================================================== --- doc/source/reference/commands/logical_select.rst 2019-01-29 10:19:11 +0900 (2b6b51908) +++ doc/source/reference/commands/logical_select.rst 2019-01-30 12:15:21 +0900 (c57e0aa42) @@ -52,6 +52,9 @@ parameters are optional:: [query=null] [drilldown_filter=null] [post_filter=null] + [load_table=null] + [load_columns=null] + [load_values=null] There are some parameters that can be only used as named parameters. You can't use these parameters as ordered parameters. You @@ -518,6 +521,89 @@ entries have ``system`` or ``use`` words: .. --post_filter 'n_likes_sum_per_tag > 10' \ .. --output_columns _key,n_likes,n_likes_sum_per_tag +.. _logical-select-load-table: + +``load_table`` +"""""""""""""" + +.. versionadded:: 8.1.1 + +You can store specified a table a result of ``logical_select`` with ``--load_table``, ``--load-columns`` and ``--load_values`` arguments. +``--load_table`` specifies a table name for storing a result of ``logical_select``. + +You must specify a table that already exists. + +This argument must use with :ref:`logical-select-load-columns` and :ref:`logical-select-load-values`. + +Here is an example that can store ``_id`` and ``timestamp`` that a result of ``logical_select`` in a Logs table specified by ``--load_table``. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_select/load_table.log +.. table_create Logs_20150203 TABLE_HASH_KEY ShortText +.. column_create Logs_20150203 timestamp COLUMN_SCALAR Time +.. table_create Logs_20150204 TABLE_HASH_KEY ShortText +.. column_create Logs_20150204 timestamp COLUMN_SCALAR Time +.. +.. table_create Logs TABLE_HASH_KEY ShortText +.. column_create Logs original_id COLUMN_SCALAR UInt32 +.. column_create Logs timestamp_text COLUMN_SCALAR ShortText +.. +.. load --table Logs_20150203 +.. [ +.. { +.. "_key": "2015-02-03:1", +.. "timestamp": "2015-02-03 10:49:00" +.. }, +.. { +.. "_key": "2015-02-03:2", +.. "timestamp": "2015-02-03 12:49:00" +.. } +.. ] +.. load --table Logs_20150204 +.. [ +.. { +.. "_key": "2015-02-04:1", +.. "timestamp": "2015-02-04 00:00:00" +.. } +.. ] +.. logical_select \ +.. --logical_table Logs \ +.. --shard_key timestamp \ +.. --load_table Logs \ +.. --load_columns "original_id, timestamp_text" \ +.. --load_values "_id, timestamp" +.. select --table Logs + +.. _logical-select-load-columns: + +``load_columns`` +"""""""""""""""" + +.. versionadded:: 8.1.1 + +Specifies columns of a table that specifying ``--load-table``. +Stores value of columns that specified with :ref:`logical-select-load-values` in columns that specified with this argument. +You must specify columns that already exists. + +This argument must use with :ref:`logical-select-load-table` and :ref:`logical-select-load-values`. + +See example of ``--load_table`` for how to use this argument. + +.. _logical-select-load-values: + +``load_values`` +""""""""""""""" + +.. versionadded:: 8.1.1 + +Specifies columns of result of ``logical_select``. +Specifies columns for storing values into columns that specified with :ref:`logical-select-load-columns`. +You must specify columns that already exists. + +This argument must use with :ref:`logical-select-load-table` and :ref:`logical-select-load-columns`. + +See example of ``--load_table`` for how to use this argument. + .. _logical-select-advanced-search-parameters: Advanced search parameters -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190130/e2b6268f/attachment-0001.html>