github.com/apache/beam/sdks/v2@v2.48.2/java/testing/tpcds/src/main/resources/queries/query41.sql (about)

     1  -- Licensed to the Apache Software Foundation (ASF) under one
     2  -- or more contributor license agreements.  See the NOTICE file
     3  -- distributed with this work for additional information
     4  -- regarding copyright ownership.  The ASF licenses this file
     5  -- to you under the Apache License, Version 2.0 (the
     6  -- "License"); you may not use this file except in compliance
     7  -- with the License.  You may obtain a copy of the License at
     8  --
     9  --     http://www.apache.org/licenses/LICENSE-2.0
    10  --
    11  -- Unless required by applicable law or agreed to in writing, software
    12  -- distributed under the License is distributed on an "AS IS" BASIS,
    13  -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  -- See the License for the specific language governing permissions and
    15  -- limitations under the License.
    16  
    17  select  distinct(i_product_name)
    18   from item i1
    19   where i_manufact_id between 742 and 742+40 
    20     and (select count(*) as item_cnt
    21          from item
    22          where (i_manufact = i1.i_manufact and
    23          ((i_category = 'Women' and 
    24          (i_color = 'orchid' or i_color = 'papaya') and 
    25          (i_units = 'Pound' or i_units = 'Lb') and
    26          (i_size = 'petite' or i_size = 'medium')
    27          ) or
    28          (i_category = 'Women' and
    29          (i_color = 'burlywood' or i_color = 'navy') and
    30          (i_units = 'Bundle' or i_units = 'Each') and
    31          (i_size = 'N/A' or i_size = 'extra large')
    32          ) or
    33          (i_category = 'Men' and
    34          (i_color = 'bisque' or i_color = 'azure') and
    35          (i_units = 'N/A' or i_units = 'Tsp') and
    36          (i_size = 'small' or i_size = 'large')
    37          ) or
    38          (i_category = 'Men' and
    39          (i_color = 'chocolate' or i_color = 'cornflower') and
    40          (i_units = 'Bunch' or i_units = 'Gross') and
    41          (i_size = 'petite' or i_size = 'medium')
    42          ))) or
    43         (i_manufact = i1.i_manufact and
    44          ((i_category = 'Women' and 
    45          (i_color = 'salmon' or i_color = 'midnight') and 
    46          (i_units = 'Oz' or i_units = 'Box') and
    47          (i_size = 'petite' or i_size = 'medium')
    48          ) or
    49          (i_category = 'Women' and
    50          (i_color = 'snow' or i_color = 'steel') and
    51          (i_units = 'Carton' or i_units = 'Tbl') and
    52          (i_size = 'N/A' or i_size = 'extra large')
    53          ) or
    54          (i_category = 'Men' and
    55          (i_color = 'purple' or i_color = 'gainsboro') and
    56          (i_units = 'Dram' or i_units = 'Unknown') and
    57          (i_size = 'small' or i_size = 'large')
    58          ) or
    59          (i_category = 'Men' and
    60          (i_color = 'metallic' or i_color = 'forest') and
    61          (i_units = 'Gram' or i_units = 'Ounce') and
    62          (i_size = 'petite' or i_size = 'medium')
    63          )))) > 0
    64   order by i_product_name
    65   limit 100