<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~   or more contributor license agreements.  See the NOTICE file
  ~   distributed with this work for additional information
  ~   regarding copyright ownership.  The ASF licenses this file
  ~   to you under the Apache License, Version 2.0 (the
  ~   "License"); you may not use this file except in compliance
  ~   with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  -->

<datamodel release="192" name="test_scenario">
    <datamapping>
        <column>
            <!-- This column type defines what will generally happen to VARCHAR fields unless they are explicitly defined or overridden elsewhere -->
            <type>VARCHAR</type>
            <dataSequence>SEQUENTIAL</dataSequence>
            <length>15</length>
            <name>GENERAL_VARCHAR</name>
        </column>
        <column>
            <type>CHAR</type>
            <dataSequence>SEQUENTIAL</dataSequence>
            <length>15</length>
            <name>GENERAL_CHAR</name>
        </column>
        <column>
            <type>DATE</type>
            <!--SEQUENTIAL is unsupported for DATE -->
            <dataSequence>RANDOM</dataSequence>
            <!-- Number [0-100] that represents the probability of creating a null value -->
            <!-- The higher the number, the more like the value will returned will be null -->
            <!-- Leaving this tag out is equivalent to having a 0 probability. i.e. never null -->
            <nullChance>0</nullChance>
            <minValue>1975</minValue>
            <maxValue>2025</maxValue>
            <name>GENERAL_DATE</name>
        </column>
        <column>
            <type>DECIMAL</type>
            <dataSequence>RANDOM</dataSequence>
            <minValue>0</minValue>
            <maxValue>1</maxValue>

            <!-- Precision is limited to 18 -->
            <precision>18</precision>
            <!-- Number [0-100] that represents the probability of creating a null value -->
            <!-- The higher the number, the more like the value will returned will be null -->
            <!-- Leaving this tag out is equivalent to having a 0 probability. i.e. never null -->
            <nullChance>10</nullChance>
            <name>GENERAL_DECIMAL</name>
        </column>
        <column>
            <type>INTEGER</type>
            <dataSequence>RANDOM</dataSequence>
            <minValue>1</minValue>
            <maxValue>50000000</maxValue>
            <!-- Number [0-100] that represents the probability of creating a null value -->
            <!-- The higher the number, the more like the value will returned will be null -->
            <!-- Leaving this tag out is equivalent to having a 0 probability. i.e. never null -->
            <name>GENERAL_INTEGER</name>
        </column>
        <column>
            <type>DATE</type>
            <name>CREATED_DATE</name>
            <minValue>1975</minValue>
            <maxValue>2025</maxValue>
            <valuelist>
                <!-- Distributes randomly with equal chance of being picked -->
                <datavalue distribution="80">
                    <!-- Joda time format: yyyy-MM-dd HH:mm:ss.SSS ZZZ -->
                    <minValue>2019-09-15 00:01:00.000</minValue>
                    <maxValue>2019-09-15 11:00:00.000</maxValue>
                </datavalue>
                <datavalue distribution="10">
                    <value>2019-09-19 00:01:00.000</value>
                </datavalue>
                <datavalue distribution="10">
                    <minValue>2019-09-22 00:01:00.000</minValue>
                    <maxValue>2019-09-22 00:01:00.300</maxValue>
                </datavalue>
            </valuelist>
        </column>
        <column>
            <type>CHAR</type>
            <userDefined>true</userDefined>
            <dataSequence>LIST</dataSequence>
            <length>15</length>
            <name>VAL_STRING</name>
            <valuelist>
                <!-- Distributes randomly with equal chance of being picked -->
                <datavalue distribution="50">
                    <value>KjhoOmnNbBs9kWs</value>
                </datavalue>
                <datavalue distribution="50">
                    <value>VAL123</value>
                </datavalue>
            </valuelist>
        </column>
    </datamapping>
    <scenarios>
        <scenario tableName="PHERF.USER_DEFINED_TEST" rowCount="100000" name="myscenario">
            <!-- Scenario level rule overrides will be unsupported in V1.
                    You can use the general datamappings in the mean time-->
            <dataOverride>
                <column>
                    <type>VARCHAR</type>
                    <userDefined>true</userDefined>
                    <dataSequence>RANDOM</dataSequence>
                    <length>10</length>
                    <name>DO_NOT_USE</name>
                </column>
            </dataOverride>
            <!--Note: 1. Minimum of executionDurationInMs or numberOfExecutions. Which ever is reached first
                      2. DDL included in query are executed only once on start of querySet execution.
            -->
            <querySet concurrency="1-3" executionType="SERIAL" executionDurationInMs="5000" numberOfExecutions="10">
                <!-- queryGroup is a way to organize queries across tables or scenario files.
                    The value will be dumped to results. This gives a value to group by on reporting to compare queries -->
                <query id="q1" expectedAggregateRowCount="100000" timeoutDuration="0"
                       statement="SELECT COUNT(*) FROM PHERF.USER_DEFINED_TEST"/>
                <query id="q2" expectedAggregateRowCount="100000" timeoutDuration="9223372036854775807"
                       statement="SELECT COUNT(*) FROM PHERF.USER_DEFINED_TEST"/>
                <query id="q3" expectedAggregateRowCount="100000"
                       statement="SELECT COUNT(*) FROM PHERF.USER_DEFINED_TEST"/>

            </querySet>
        </scenario>
    </scenarios>
</datamodel>
