public class InsertRecordsRandomRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.insertRecordsRandom(InsertRecordsRandomRequest)
.
Generates a specified number of random records and adds them to the given table. There is an optional parameter that allows the user to customize the ranges of the column values. It also allows the user to specify linear profiles for some or all columns in which case linear values are generated rather than random ones. Only individual tables are supported for this operation.
This operation is synchronous, meaning that a response will not be returned until all random records are fully available.
Modifier and Type | Class and Description |
---|---|
static class |
InsertRecordsRandomRequest.Options
Optional parameter to pass in specifications for the randomness of the
values.
|
Constructor and Description |
---|
InsertRecordsRandomRequest()
Constructs an InsertRecordsRandomRequest object with default parameters.
|
InsertRecordsRandomRequest(String tableName,
long count,
Map<String,Map<String,Double>> options)
Constructs an InsertRecordsRandomRequest object with the specified
parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
long |
getCount() |
Map<String,Map<String,Double>> |
getOptions() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getTableName() |
int |
hashCode() |
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
InsertRecordsRandomRequest |
setCount(long count) |
InsertRecordsRandomRequest |
setOptions(Map<String,Map<String,Double>> options) |
InsertRecordsRandomRequest |
setTableName(String tableName) |
String |
toString() |
public InsertRecordsRandomRequest()
public InsertRecordsRandomRequest(String tableName, long count, Map<String,Map<String,Double>> options)
tableName
- Table to which random records will be added. Must be
an existing table. Also, must be an individual table,
not a collection of tables, nor a view of a table.count
- Number of records to generate.options
- Optional parameter to pass in specifications for the
randomness of the values. This map is different from
the *options* parameter of most other endpoints in that
it is a map of string to map of string to doubles, while
most others are maps of string to string. In this map,
the top level keys represent which column's parameters
are being specified, while the internal keys represents
which parameter is being specified. The parameters that
can be specified are: *min*, *max*, and *interval*.
These parameters take on different meanings depending on
the type of the column. Below follows a more detailed
description of the map:
SEED
: If provided, the internal random number generator
will be initialized with the given value. The minimum
is 0. This allows for the same set of random numbers to
be generated across invocation of this endpoint in case
the user wants to repeat the test. Since options
, is a map of maps, we need an internal map to
provide the seed value. For example, to pass 100 as the
seed value through this parameter, you need something
equivalent to: 'options' = {'seed': { 'value': 100 } }
VALUE
: Pass the seed value here.
ALL
: This key indicates that the specifications relayed
in the internal map are to be applied to all columns of
the records.
MIN
: For numerical columns, the minimum of the
generated values is set to this value. Default is
-99999. For point, shape, and track semantic types, min
for numeric 'x' and 'y' columns needs to be within
[-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the
default minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly
generated strings is set to this value (default is 1).
If both minimum and maximum are provided, minimum must
be less than or equal to max. Value needs to be within
[1, 200].
If the min is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
MAX
: For numerical columns, the maximum of the
generated values is set to this value. Default is 99999.
For point, shape, and track semantic types, max for
numeric 'x' and 'y' columns needs to be within [-180,
180] and [-90, 90], respectively. The default minimum
possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly
generated strings is set to this value (default is 200).
If both minimum and maximum are provided, *max* must be
greater than or equal to *min*. Value needs to be within
[1, 200].
If the *max* is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
INTERVAL
: If specified, then generate values for all
columns linearly and evenly spaced with the given
interval value starting at the minimum value (instead of
generating random data). *Any provided max value is
disregarded.* For string-type columns, the interval
value is ignored but the string values would be
generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed
with an underscore and a running counter (starting at
0). No nulls would be generated for nullable columns.
NULL_PERCENTAGE
: If specified, then generate the given
percentage of the count as nulls for all nullable
columns. This option will be ignored for non-nullable
columns. The value must be within the range [0, 1.0].
The default value is 5% (0.05).
ATTR_NAME
: Set the following parameters for the column
specified by the key. This overrides any parameter set
by all
.
MIN
: For numerical columns, the minimum of the
generated values is set to this value. Default is
-99999. For point, shape, and track semantic types, min
for numeric 'x' and 'y' columns needs to be within
[-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the
default minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly
generated strings is set to this value (default is 1).
If both minimum and maximum are provided, minimum must
be less than or equal to max. Value needs to be within
[1, 200].
If the min is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
MAX
: For numerical columns, the maximum of the
generated values is set to this value. Default is 99999.
For point, shape, and track semantic types, max for
numeric 'x' and 'y' columns needs to be within [-180,
180] and [-90, 90], respectively. The default minimum
possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly
generated strings is set to this value (default is 200).
If both minimum and maximum are provided, *max* must be
greater than or equal to *min*. Value needs to be within
[1, 200].
If the *max* is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
INTERVAL
: If specified, then generate values for all
columns linearly and evenly spaced with the given
interval value starting at the minimum value (instead of
generating random data). *Any provided max value is
disregarded.* For string-type columns, the interval
value is ignored but the string values would be
generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed
with an underscore and a running counter (starting at
0). No nulls would be generated for nullable columns.
NULL_PERCENTAGE
: If specified and if this column is
nullable, then generate the given percentage of the
count as nulls. This option will result in an error if
the column is not nullable. The value must be within
the range [0, 1.0]. The default value is 5% (0.05).
TRACK_LENGTH
: This key-map pair is only valid for track
type data sets (an error is thrown otherwise). No nulls
would be generated for nullable columns.
MIN
: Minimum possible length for generated series;
default is 100 records per series. Must be an integral
value within the range [1, 500]. If both min and max are
specified, min must be less than or equal to max.
MAX
: Maximum possible length for generated series;
default is 500 records per series. Must be an integral
value within the range [1, 500]. If both min and max are
specified, max must be greater than or equal to min.
public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public InsertRecordsRandomRequest setTableName(String tableName)
tableName
- Table to which random records will be added. Must be
an existing table. Also, must be an individual table,
not a collection of tables, nor a view of a table.this
to mimic the builder pattern.public long getCount()
public InsertRecordsRandomRequest setCount(long count)
count
- Number of records to generate.this
to mimic the builder pattern.public Map<String,Map<String,Double>> getOptions()
SEED
: If provided, the internal random number generator will be
initialized with the given value. The minimum is 0. This
allows for the same set of random numbers to be generated across
invocation of this endpoint in case the user wants to repeat the
test. Since options
, is a map of maps, we need an
internal map to provide the seed value. For example, to pass
100 as the seed value through this parameter, you need something
equivalent to: 'options' = {'seed': { 'value': 100 } }
VALUE
: Pass the seed value here.
ALL
:
This key indicates that the specifications relayed in the
internal map are to be applied to all columns of the records.
MIN
:
For numerical columns, the minimum of the generated values is
set to this value. Default is -99999. For point, shape, and
track semantic types, min for numeric 'x' and 'y' columns needs
to be within [-180, 180] and [-90, 90], respectively. The
default minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the default
minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly generated
strings is set to this value (default is 1). If both minimum and
maximum are provided, minimum must be less than or equal to max.
Value needs to be within [1, 200].
If the min is outside the accepted ranges for strings columns
and 'x' and 'y' columns for point/shape/track types, then those
parameters will not be set; however, an error will not be thrown
in such a case. It is the responsibility of the user to use the
all
parameter judiciously.
MAX
:
For numerical columns, the maximum of the generated values is
set to this value. Default is 99999. For point, shape, and track
semantic types, max for numeric 'x' and 'y' columns needs to be
within [-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly generated
strings is set to this value (default is 200). If both minimum
and maximum are provided, *max* must be greater than or equal to
*min*. Value needs to be within [1, 200].
If the *max* is outside the accepted ranges for strings columns
and 'x' and 'y' columns for point/shape/track types, then those
parameters will not be set; however, an error will not be thrown
in such a case. It is the responsibility of the user to use the
all
parameter judiciously.
INTERVAL
: If specified, then generate values for all columns
linearly and evenly spaced with the given interval value
starting at the minimum value (instead of generating random
data). *Any provided max value is disregarded.* For string-type
columns, the interval value is ignored but the string values
would be generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed with an
underscore and a running counter (starting at 0). No nulls
would be generated for nullable columns.
NULL_PERCENTAGE
: If specified, then generate the given
percentage of the count as nulls for all nullable columns. This
option will be ignored for non-nullable columns. The value must
be within the range [0, 1.0]. The default value is 5% (0.05).
ATTR_NAME
: Set the following parameters for the column
specified by the key. This overrides any parameter set by all
.
MIN
:
For numerical columns, the minimum of the generated values is
set to this value. Default is -99999. For point, shape, and
track semantic types, min for numeric 'x' and 'y' columns needs
to be within [-180, 180] and [-90, 90], respectively. The
default minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the default
minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly generated
strings is set to this value (default is 1). If both minimum and
maximum are provided, minimum must be less than or equal to max.
Value needs to be within [1, 200].
If the min is outside the accepted ranges for strings columns
and 'x' and 'y' columns for point/shape/track types, then those
parameters will not be set; however, an error will not be thrown
in such a case. It is the responsibility of the user to use the
all
parameter judiciously.
MAX
:
For numerical columns, the maximum of the generated values is
set to this value. Default is 99999. For point, shape, and track
semantic types, max for numeric 'x' and 'y' columns needs to be
within [-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly generated
strings is set to this value (default is 200). If both minimum
and maximum are provided, *max* must be greater than or equal to
*min*. Value needs to be within [1, 200].
If the *max* is outside the accepted ranges for strings columns
and 'x' and 'y' columns for point/shape/track types, then those
parameters will not be set; however, an error will not be thrown
in such a case. It is the responsibility of the user to use the
all
parameter judiciously.
INTERVAL
: If specified, then generate values for all columns
linearly and evenly spaced with the given interval value
starting at the minimum value (instead of generating random
data). *Any provided max value is disregarded.* For string-type
columns, the interval value is ignored but the string values
would be generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed with an
underscore and a running counter (starting at 0). No nulls
would be generated for nullable columns.
NULL_PERCENTAGE
: If specified and if this column is nullable,
then generate the given percentage of the count as nulls. This
option will result in an error if the column is not nullable.
The value must be within the range [0, 1.0]. The default value
is 5% (0.05).
TRACK_LENGTH
: This key-map pair is only valid for track type
data sets (an error is thrown otherwise). No nulls would be
generated for nullable columns.
MIN
:
Minimum possible length for generated series; default is 100
records per series. Must be an integral value within the range
[1, 500]. If both min and max are specified, min must be less
than or equal to max.
MAX
:
Maximum possible length for generated series; default is 500
records per series. Must be an integral value within the range
[1, 500]. If both min and max are specified, max must be greater
than or equal to min.
public InsertRecordsRandomRequest setOptions(Map<String,Map<String,Double>> options)
options
- Optional parameter to pass in specifications for the
randomness of the values. This map is different from
the *options* parameter of most other endpoints in that
it is a map of string to map of string to doubles, while
most others are maps of string to string. In this map,
the top level keys represent which column's parameters
are being specified, while the internal keys represents
which parameter is being specified. The parameters that
can be specified are: *min*, *max*, and *interval*.
These parameters take on different meanings depending on
the type of the column. Below follows a more detailed
description of the map:
SEED
: If provided, the internal random number generator
will be initialized with the given value. The minimum
is 0. This allows for the same set of random numbers to
be generated across invocation of this endpoint in case
the user wants to repeat the test. Since options
, is a map of maps, we need an internal map to
provide the seed value. For example, to pass 100 as the
seed value through this parameter, you need something
equivalent to: 'options' = {'seed': { 'value': 100 } }
VALUE
: Pass the seed value here.
ALL
: This key indicates that the specifications relayed
in the internal map are to be applied to all columns of
the records.
MIN
: For numerical columns, the minimum of the
generated values is set to this value. Default is
-99999. For point, shape, and track semantic types, min
for numeric 'x' and 'y' columns needs to be within
[-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the
default minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly
generated strings is set to this value (default is 1).
If both minimum and maximum are provided, minimum must
be less than or equal to max. Value needs to be within
[1, 200].
If the min is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
MAX
: For numerical columns, the maximum of the
generated values is set to this value. Default is 99999.
For point, shape, and track semantic types, max for
numeric 'x' and 'y' columns needs to be within [-180,
180] and [-90, 90], respectively. The default minimum
possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly
generated strings is set to this value (default is 200).
If both minimum and maximum are provided, *max* must be
greater than or equal to *min*. Value needs to be within
[1, 200].
If the *max* is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
INTERVAL
: If specified, then generate values for all
columns linearly and evenly spaced with the given
interval value starting at the minimum value (instead of
generating random data). *Any provided max value is
disregarded.* For string-type columns, the interval
value is ignored but the string values would be
generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed
with an underscore and a running counter (starting at
0). No nulls would be generated for nullable columns.
NULL_PERCENTAGE
: If specified, then generate the given
percentage of the count as nulls for all nullable
columns. This option will be ignored for non-nullable
columns. The value must be within the range [0, 1.0].
The default value is 5% (0.05).
ATTR_NAME
: Set the following parameters for the column
specified by the key. This overrides any parameter set
by all
.
MIN
: For numerical columns, the minimum of the
generated values is set to this value. Default is
-99999. For point, shape, and track semantic types, min
for numeric 'x' and 'y' columns needs to be within
[-180, 180] and [-90, 90], respectively. The default
minimum possible values for these columns in such cases
are -180.0 and -90.0. For the 'TIMESTAMP' column, the
default minimum corresponds to Jan 1, 2010.
For string columns, the minimum length of the randomly
generated strings is set to this value (default is 1).
If both minimum and maximum are provided, minimum must
be less than or equal to max. Value needs to be within
[1, 200].
If the min is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
MAX
: For numerical columns, the maximum of the
generated values is set to this value. Default is 99999.
For point, shape, and track semantic types, max for
numeric 'x' and 'y' columns needs to be within [-180,
180] and [-90, 90], respectively. The default minimum
possible values for these columns in such cases are
180.0 and 90.0.
For string columns, the maximum length of the randomly
generated strings is set to this value (default is 200).
If both minimum and maximum are provided, *max* must be
greater than or equal to *min*. Value needs to be within
[1, 200].
If the *max* is outside the accepted ranges for strings
columns and 'x' and 'y' columns for point/shape/track
types, then those parameters will not be set; however,
an error will not be thrown in such a case. It is the
responsibility of the user to use the all
parameter judiciously.
INTERVAL
: If specified, then generate values for all
columns linearly and evenly spaced with the given
interval value starting at the minimum value (instead of
generating random data). *Any provided max value is
disregarded.* For string-type columns, the interval
value is ignored but the string values would be
generated following the pattern:
'attrname_creationIndex#', i.e. the column name suffixed
with an underscore and a running counter (starting at
0). No nulls would be generated for nullable columns.
NULL_PERCENTAGE
: If specified and if this column is
nullable, then generate the given percentage of the
count as nulls. This option will result in an error if
the column is not nullable. The value must be within
the range [0, 1.0]. The default value is 5% (0.05).
TRACK_LENGTH
: This key-map pair is only valid for track
type data sets (an error is thrown otherwise). No nulls
would be generated for nullable columns.
MIN
: Minimum possible length for generated series;
default is 100 records per series. Must be an integral
value within the range [1, 500]. If both min and max are
specified, min must be less than or equal to max.
MAX
: Maximum possible length for generated series;
default is 500 records per series. Must be an integral
value within the range [1, 500]. If both min and max are
specified, max must be greater than or equal to min.
this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2017. All rights reserved.