Null

Null

Generates a NULL value with a configurable probability. If the generator decides against generating NULL, it runs the specified sub-generator to generate the final field value.

Attributes
Name Description Required Min Max Allowed Values
probability Content type: Double (between 0.0 and 1.0)
Sets the probability for generating a NULL value.
yes 1 1
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
sameChoiceAs Content type: Empty
Requires a <field> and a <generatorByID> attribute (in same table) to pick the row number from. If specified this Null does not choose a random row, but it uses the same row as the referenced generator.
Default: <not set>
no 0 1
gen Value Generator for this field no 0 1

Examples

  1. Null or Static Value

    Generates NULL (empty) or the number 1000.

    Schema config for Null or Static Value
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="Nulls">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Null or Static Value-->
          <!--Generates NULL (empty) or the number 1000.-->
          <field name="thousand_or_nothing" size="" type="NUMERIC">
            <gen_Null probability="0.5">
              <gen_StaticValue>
                <value>1000</value>
              </gen_StaticValue>
            </gen_Null>
          </field>
          </table>
    </schema>
    
    Output for Null or Static Value
    1000
    
    1000
    
    1000
    1000
    1000
    
    
    
    
  2. Null or Probability

    Generates NULL (empty) or a random word given by the specified probability distribution.

    Schema config for Null or Probability
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="Nulls">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Null or Probability-->
          <!--Generates NULL (empty) or a random word given by the specified probability distribution.-->
          <field name="occupation" size="" type="VARCHAR">
            <gen_Null probability="0.1">
              <gen_Probability>
                <!-- Student -->
                <probability value="0.7">
                  <gen_StaticValue>
                    <value>Student</value>
                  </gen_StaticValue>
                </probability>
    
                <!-- Professor -->
                <probability value="0.1">
                  <gen_StaticValue>
                    <value>Professor</value>
                  </gen_StaticValue>
                </probability>
    
                <!-- Faculty Member -->
                <probability value="0.2">
                  <gen_StaticValue>
                    <value>Faculty Member</value>
                  </gen_StaticValue>
                </probability>
    
              </gen_Probability>
            </gen_Null>
          </field>
          </table>
    </schema>
    
    Output for Null or Probability
    Faculty Member
    
    
    
    Faculty Member
    Student
    Student
    Faculty Member
    Professor
    Student
2.7-83fb0 | 2020-04-22