Google Cloud Storage V2 Connector > Mappings for Google Cloud Storage > Directory-level partitioning for mappings in advanced mode
  

Directory-level partitioning for mappings in advanced mode

When you create a mapping in advanced mode, you can read from and write to partition columns.
You can organize tables or data sets into partitions to group the same type of data based on a column or partition key. You can select one or more partition columns in a table or data set.
To read from partition columns, select a partition directory and identify the partition columns. To write to partition columns, you can add partition columns from the list of fields and change the partition order, if required.
You can read data from or write data to partition columns for the following file formats:

Importing partition folders

Consider the following rules and guidelines when you import partition folders:

Reading from partition columns

You can select the directory source type and view the list of partition columns. You can also view the order in which the fields were selected for partitioning.
  1. 1Select a directory from the list of source objects.
  2. 2Select the Is Directory option in the Advanced Source Properties.
  3. Select the Is Directory option.
  4. 3Select the Fields tab to view the number of partitions.
  5. The partitionOrder column appears for the list of partitioned fields.
    The following image shows an example of the partitionOrder column:
  6. The image shows the partition order column.
  7. The partitionOrder column specifies whether a column is partitioned.
    In the above example, two partition columns are available. The partition order values 1 and 2 signify the order in which the year and month fields were selected for partitioning.

Writing to partition columns

You can add partition columns for a target and change the partition order of the columns.
  1. 1Click the icon in the Partitions tab to add the partition columns for a target.
  2. The following image shows the Partitions tab where you can add the partition columns: The image shows the Add button in the Partitions tab to add the partition columns.
  3. 2On the Partitions tab, select the partitioning fields from the list of available fields:
  4. The list of available fields from which you can select partitioning fields.
  5. 3Click Select.
  6. The Partitions tab shows the partition columns that you selected: The Partitions tab shows the partition columns that you selected.
    Note: You can change the partition order using the up and down arrows as shown in the following image: You can change the partition order using the up and down arrows.

Rules and guidelines for reading from and writing to a partition folder

Consider the following rules and guidelines when you read from and write to a partition folder: