Save Result

Save the last result as a new table.

Syntax

save result as
  [ temporary | temp ] table { <table spec> | <table name> }
  [in schema <schema reference>]
  [with data source <data source reference>]
  [with partitions <partition count> | with max partitions <max partition count>]
  [partition by "<partition columns>"]
  [with replace | with replace with delete]

Parameters

table spec

JSON. The specification of the table to save the result as. Note that fields are not used and persistence mapping is optional when saving a result.

table name

String. The name of the table to save the result as.

schema reference

String. The name of the schema to save the result in. Defaults to the current schema.

data source reference

String. The name of the data source to save the result with. Defaults to the default data source for the repository.

partition count

Integer. The exact number of partitions to save the resulting table with. Specifying this parameter will cause Magpie to shuffle the input data and repartition it into exactly this many partitions. This can be a computationally expensive operation. By default, Magpie specifies a maximum number of partitions for the save, as described below.

max partition count

Integer. The maximum number of partitions to save the resulting table with. If the source data contains more than this number of partitions, those partitions will be coalesced into no more than the number of partitions requested. Both partition count and max partition count cannot be specified at the same time. Defaults to the number of cores available in the Magpie cluster.

partition columns

String. A comma-separated list of column names to partition the resulting table by. Default is unpartitioned.

with replace [with delete]

None. If present and a table already exists with the same name as the target table, this command will drop the existing table and replace it with this new table. If with delete is also present, the underlying data for the existing table will be deleted. If a table does not already exist, this option has no effect. By default, an error will be thrown if a table exists with the same name as the target table.


Was this article helpful?
0 out of 0 found this helpful