[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eRuntime parameters allow you to parameterize the URI or data path and the destination table when transferring data in Cloud Storage, Azure Blob Storage, or Amazon S3.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erun_time\u003c/code\u003e parameter represents the execution time in UTC, while \u003ccode\u003erun_date\u003c/code\u003e is the date of \u003ccode\u003erun_time\u003c/code\u003e in the \u003ccode\u003e%Y%m%d\u003c/code\u003e format.\u003c/p\u003e\n"],["\u003cp\u003eTemplating syntax, using \u003ccode\u003e{run_date}\u003c/code\u003e and \u003ccode\u003e{run_time[+\\-offset]|"time_format"}\u003c/code\u003e, enables dynamic destination table names with time offsetting.\u003c/p\u003e\n"],["\u003cp\u003eRuntime parameters support partitioning destination tables by ingestion time or by a specified \u003ccode\u003eTIMESTAMP\u003c/code\u003e or \u003ccode\u003eDATE\u003c/code\u003e column, but they do not allow specifying minutes.\u003c/p\u003e\n"],["\u003cp\u003eWildcards in the URI or data path can be used in combination with parameters in the destination table name, allowing for flexible data transfer configurations, for example transfering to non-partitioned tables, and loading a snapshot of all data into an ingestion-time partitioned table.\u003c/p\u003e\n"]]],[],null,["# Runtime parameters in Amazon S3 transfers\n=========================================\n\nWhen you set up a data transfer in Cloud Storage, Azure Blob Storage, or\nAmazon Simple Storage Service (Amazon S3), you can parameterize the URI (or data path) and the destination\ntable. Parameterizing lets you load data from buckets that are organized by\ndate. These parameters are referred to as *runtime parameters* to distinguish\nthem from query parameters.\n\nWhen you use runtime parameters in a transfer, you can do the following:\n\n- Specify how you want to partition the destination table\n- Retrieve files that match a particular date\n\nAvailable runtime parameters\n----------------------------\n\nWhen you set up the Cloud Storage, Blob Storage, or\nAmazon S3 transfer, you can specify how you want to partition the\ndestination table by using runtime parameters.\n\nTemplating system\n-----------------\n\nCloud Storage, Blob Storage, and Amazon S3 transfers\nsupport runtime parameters in the destination table name by using a templating\nsyntax.\n\n#### Parameter templating syntax\n\nThe templating syntax supports basic string templating and time offsetting. Parameters are\nreferenced in the following formats:\n\n- `{run_date}`\n- `{run_time[+\\-offset]|\"time_format\"}`\n\n**Usage notes:**\n\n- No whitespace is allowed between run_time, offset, and time format.\n- To include literal curly braces in the string, you can escape them as `'\\{' and '\\}'`.\n- To include literal quotes or a vertical bar in the time_format, such as `\"YYYY|MM|DD\"`, you can escape them in the format string as: `'\\\"'` or `'\\|'`.\n\n#### Parameter templating examples\n\nThese examples demonstrate specifying destination table names with different time formats, and offsetting the run time.\n\nPartitioning options\n--------------------\n\nThere are two types of partitioned tables in BigQuery:\n\n- **Tables that are partitioned by ingestion time.** For Cloud Storage, Blob Storage, and Amazon S3 transfers, the ingestion time is the transfer's run time.\n- **Tables that are partitioned based on a column.** The column type must be a [`TIMESTAMP`](/bigquery/docs/reference/standard-sql/data-types#timestamp_type) or [`DATE`](/bigquery/docs/reference/standard-sql/data-types#date_type) column.\n\nIf the destination table is partitioned on a column, you identify the\npartitioning column when you create the destination table and specify its\nschema. Learn more about creating column-based partitioned tables in\n[Creating and using partitioned tables](/bigquery/docs/creating-column-partitions).\n| **Note:** Minutes cannot be specified when partitioning a table.\n\n### Partitioning examples\n\n- Table with no partitioning\n - Destination table: `mytable`\n- [Ingestion-time partitioned table](/bigquery/docs/partitioned-tables#ingestion_time)\n - Destination table: `mytable`\u003cvar translate=\"no\"\u003e$YYYYMMDD\u003c/var\u003e\n - Note that minutes cannot be specified.\n- [Column-partitioned table](/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables)\n - Destination table: `mytable`\n - Specify the partitioning column as a `TIMESTAMP` or `DATE` column when you create the table's schema.\n\nNotes on parameter usage\n------------------------\n\n- If you partition your data based on your local timezone, you need to manually calculate the hour offset from UTC by using the offsetting mechanism in the [templating syntax](#templating_system).\n- Minutes cannot be specified in parameters.\n- Using wildcards for the URI or data path in combination with parameters on the destination table name is allowed.\n\nRuntime parameter examples\n--------------------------\n\nThe following examples show ways to combine the wildcard character and\nparameters for common use cases. Assume the table's name is `mytable` and\nthe `run_time` is `2018-02-15 00:00:00` (UTC) for all examples.\n\n### Transfer data to a non-partitioned table\n\nThis use case applies to loading new files from a Cloud Storage,\nBlob Storage, or Amazon S3 bucket into a non-partitioned\ntable. This example uses a wildcard in the URI or data path and uses an ad hoc\nrefresh transfer to pick up new files.\n\n### Load a snapshot of all data into an ingestion-time partitioned table\n\nIn this case, all data in the specified URI or data path is transferred to a\ntable partitioned by today's date. In a refresh transfer, this configuration\npicks up files added since the last load and adds them to a particular\npartition.\n\nThis use case transfers today's data into a table partitioned on today's date.\nThis example also applies to a refresh transfer that retrieves newly added files\nthat match a certain date and loads the data into the corresponding partition.\n\nWhat's next\n-----------\n\n- Learn about [setting up an Amazon S3 transfer](/bigquery/docs/s3-transfer).\n- Learn more about the [BigQuery Data Transfer Service](/bigquery/docs/dts-introduction)."]]