code: def init_hive_schema(drill, cursor, dir_data_lc, **kwargs):
      timeout = 300
  
      dir_path = os.path.dirname(os.path.realpath(__file__))
  
      smiles_test = kwargs.get("smiles_test", False)
      if smiles_test:
          dir_data_lc = dir_data_lc + "smiles/"
          table_names = smilesTables
      else:
          dir_data_lc = dir_data_lc + "tpch/"
          table_names = tableNames
  
      for name in table_names:
          cursor.execute(
              "DROP TABLE IF EXISTS %(table)s PURGE" % {"table": name}
          )
          print("DROP TABLE IF EXISTS %(table)s" % {"table": name})
  
      # cursor.execute('select * from customer')
      # print(cursor.fetchall())
      # exit()
  
      fileSchemaType = kwargs.get("fileSchemaType")
      if fileSchemaType is not None:
          ext = get_extension(fileSchemaType)
      else:
          ext = "orc"
  
      num_files = kwargs.get("n_files")
      if num_files is not None:
          dir_data_lc = getFiles_to_tmp(dir_data_lc, num_files, ext)
  
      bool_test = kwargs.get("bool_test", None)
      if bool_test:
          drill.query(
              """
          create table dfs.tmp.`bool_orders/` as
              select CASE WHEN columns[0] = '' OR columns[0] = 'null' THEN null
                  ELSE cast(columns[0] as bigint) END as o_orderkey,
                  CASE WHEN columns[1] = '' OR columns[1] = 'null' THEN null
                  ELSE cast(columns[1] as int) END as o_custkey,
                  columns[2] as o_orderstatus,
                  CASE WHEN columns[3] = '' OR columns[3] = 'null' THEN null
                  ELSE cast(columns[3] as double) END as o_totalprice,
                  columns[4] as o_orderdate,
                  columns[5] as o_orderpriority,
                  columns[6] as o_clerk,
                  CASE WHEN columns[7] = '' OR columns[7] = 'null' THEN null
                  ELSE cast(columns[7] as int) END as o_shippriority,
                  columns[8] as o_comment,
                  CASE WHEN columns[9] = '' OR columns[9] = 'null' THEN null
                  ELSE cast(columns[9] as boolean) END as o_confirmed
          FROM table(dfs.`%(dir_data_lc)s/bool_orders_*.psv`
           (type => 'text', fieldDelimiter => '|'))
          """
              % {"dir_data_lc": dir_data_lc},
              timeout,
          )
  
      for table_name in table_names:
          column_names = get_column_names(table_name, bool_test)
          data_types = get_dtypes(table_name, bool_test)
  
          names_types = zip(column_names, data_types)
  
          column_list = ", ".join(
              [
                  name + " " + get_dtypes_hive(type)
                  for name, type in names_types
              ]
          )
  
          if ext == "orc":
              cursor.execute(
                  """CREATE EXTERNAL TABLE %(table_name)s
                              ( %(column_list)s ) STORED AS ORC"""
                  % {"table_name": table_name}
              )
  
              cursor.execute(
                  """LOAD DATA INPATH 'hdfs:%(dir_data_lc)s/%(table_name)s_*.orc'
                              INTO TABLE %(table_name)s"""
                  % {
                      "dir_data_lc": dir_data_lc,
                      "table_name": table_name,
                  }
              )
          elif ext == "parquet":
              cursor.execute(
                  """CREATE EXTERNAL TABLE %(table_name)s
                              ( %(column_list)s ) STORED AS PARQUET"""
                  % {"table_name": table_name}
              )
  
              cursor.execute(
                  """LOAD DATA INPATH
                             'hdfs:%(dir_data_lc)s/%(table_name)s_*.parquet'
                              INTO TABLE %(table_name)s"""
                  % {
                      "dir_data_lc": dir_data_lc,
                      "table_name": table_name,
                  }
              )
  
              # cursor.execute('DROP TABLE TRANSACTIONS')
  
              # cursor.execute('''CREATE TABLE TRANSACTIONS(
              #             t_person_id BIGINT,
              #             t_company_id INT,
              #             t_amount BIGINT,
              #             t_year INT
              #             )
              #             STORED AS PARQUET''')
  
              # cursor.execute('''LOAD DATA INPATH
              #     'hdfs:/home/kharoly/blazingsql/DataSet100MB_2/transactions/
              #      transactions.parquet'
              #      OVERWRITE INTO TABLE TRANSACTIONS''')
  
              # cursor.execute('''drop table PTRANSACTIONS;
              #     CREATE TABLE PTRANSACTIONS(
              #     t_person_id INT,
              #     t_amount INT
              #     )
              #     PARTITIONED BY (t_year INT, t_company_id INT)
              #     STORED AS PARQUET''')
  
              # cursor.execute('''INSERT OVERWRITE TABLE PTRANSACTIONS
              #        PARTITION (t_year=2017, t_company_id=1)
              #        SELECT t_person_id, t_amount FROM TRANSACTIONS
              #        WHERE t_year=2017 and t_company_id=1''')
  
              # cursor.execute('''SHOW PARTITIONS PTRANSACTIONS''')
  
              # break
          elif ext == "psv":
              cursor.execute(
                  """CREATE EXTERNAL TABLE %(table_name)s
                              ( %(column_list)s ) ROW FORMAT DELIMITED FIELDS
                              TERMINATED BY '|' STORED AS TEXTFILE"""
                  % {
                      "table_name": table_name,
                      "column_list": column_list,
                  }
              )
  
              cursor.execute(
                  """LOAD DATA INPATH 'hdfs:%(dir_data_lc)s/%(table_name)s_*.psv'
                              INTO TABLE %(table_name)s"""
                  % {
                      "dir_data_lc": dir_data_lc,
                      "table_name": table_name,
                  }
              )
  
imports: import os
  import re
  import tempfile
  from collections import OrderedDict
  from os import listdir
  from os.path import isdir
  import glob
  from enum import IntEnum, unique
  import cudf
  import dask_cudf
  import numpy
  import pandas
  import pyblazing
  from blazingsql import DataType
  from pyhive import hive
  from Configuration import Settings
  from DemoTest.chronometer import Chronometer
label_desc: Use image node_id 8 for calling a global function with example usage: init_hive_schema(drill, cursor, dir_data_lc) without return types