Parameters:
     - db_name
     - tbl_name
     - part_name
     - col_name
199626
def get_partition_column_statistics(self, db_name, tbl_name, part_name, col_name):
    
    self.send_get_partition_column_statistics(db_name, tbl_name, part_name, col_name)
    return self.recv_get_partition_column_statistics()
336423
def find_holes(db_module, db, table_name, column_name, _range, filter=None):
    
    if not filter:
        filter = {"match_all": {}}

    _range = wrap(_range)
    params = {
        "min": _range.min,
        "max": _range.max - 1,
        "column_name": db_module.quote_column(column_name),
        "table_name": db_module.quote_column(table_name),
        "filter": esfilter2sqlwhere(filter)
    }

    min_max = db.query("""
        SELECT
            min({{column_name}}) `min`,
            max({{column_name}})+1 `max`
        FROM
            {{table_name}} a
        WHERE
            a.{{column_name}} BETWEEN {{min}} AND {{max}} AND
            {{filter}}
    """, params)[0]

    db.execute("SET @last={{min}}-1", {"min": _range.min})
    ranges = db.query("""
        SELECT
            prev_rev+1 `min`,
            curr_rev `max`
        FROM (
            SELECT
                a.{{column_name}}-@last diff,
                @last prev_rev,
                @last:=a.{{column_name}} curr_rev
            FROM
                {{table_name}} a
            WHERE
                a.{{column_name}} BETWEEN {{min}} AND {{max}} AND
                {{filter}}
            ORDER BY
                a.{{column_name}}
        ) a
        WHERE
            diff>1
    """, params)

    if ranges:
        ranges.append({"min": min_max.max, "max": _range.max})
    else:
        if min_max.min:
            ranges.append({"min": _range.min, "max": min_max.min})
            ranges.append({"min": min_max.max, "max": _range.max})
        else:
            ranges.append(_range)

    return ranges
274671
def name_parts(self):
        """"""

        default = PartialMixin.ANY

        return ([(k, default, True)
                for k, _, _ in PartitionName._name_parts]
                +
                [(k, default, True)
                 for k, _, _ in Name._generated_names]
                )
630994
def alter_partition_with_environment_context(self, db_name, tbl_name, new_part, environment_context):
    
    self.send_alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context)
    self.recv_alter_partition_with_environment_context()
833134
def set_col_name(self, index, name):
        
        javabridge.call(self.jobject, "setColName", "(ILjava/lang/String;)V", index, name)
257949
def get_column_names(context, query):
        """"""
        table_info = context.sql_client.send(query)
        if 'fields' in table_info:
            return table_info['fields']

        return None
595282
def get_part_specs_by_filter(self, db_name, tbl_name, filter, max_parts):
    
    self.send_get_part_specs_by_filter(db_name, tbl_name, filter, max_parts)
    return self.recv_get_part_specs_by_filter()
1307601
def quote_table_name(name)
      name.to_s.split('.').map{ |n| n.split('@').map{ |m| quote_column_name(m) }.join('@') }.join('.')
    end
424088
def drop_partition_by_name_with_environment_context(self, db_name, tbl_name, part_name, deleteData, environment_context):
    
    self.send_drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context)
    return self.recv_drop_partition_by_name_with_environment_context()
1120745
def _parse_db_lib(cls, library):
        
        database_name = library.split('.', 2)
        if len(database_name) == 2:
            library = database_name[1]
            if database_name[0].startswith(cls.DB_PREFIX):
                database_name = database_name[0]
            else:
                database_name = cls.DB_PREFIX + '_' + database_name[0]
        else:
            database_name = cls.DB_PREFIX
        return database_name, library
1161633
def merge_databases(master, part):
    
    mcur = master.cursor()
    pcur = part.cursor()

    logger.debug("Merging databases...")
    tables = get_table_list(part)
    for table in tables:
        cols = get_table_columns(part, table)
        pcur.execute("SELECT * FROM '%s'" % table)
        rows = pcur.fetchall()
        if rows:
            try:
                logger.debug("Found   {n} rows of table '{name}' in master".format(name=table, n=rows[0][1]-1))
            except Exception as e:
                logging.error(e)
            if not check_table_exists(master, table):
                create_table(master, table, cols)

            args = ("?," * len(cols))[:-1]
            query = "INSERT INTO '{name}' VALUES ({args})".format(name=table, args=args)
            mcur.executemany(query, tuple(tuple(r) for r in rows))
            logger.debug("Merging {m} rows of table '{name}' into master".format(name=table, m=len(rows)))

    master.commit()
1105083
def get_partitions(self, db_name, tbl_name, max_parts):
    
    self.send_get_partitions(db_name, tbl_name, max_parts)
    return self.recv_get_partitions()
262001
def get_num_partitions_by_filter(self, db_name, tbl_name, filter):
    
    self.send_get_num_partitions_by_filter(db_name, tbl_name, filter)
    return self.recv_get_num_partitions_by_filter()
961703
def isPartitionMarkedForEvent(self, db_name, tbl_name, part_vals, eventType):
    
    self.send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType)
    return self.recv_isPartitionMarkedForEvent()
342018
def get_table(self, dbname, tbl_name):
    
    self.send_get_table(dbname, tbl_name)
    return self.recv_get_table()
485251
def delete_table_column_statistics(self, db_name, tbl_name, col_name):
    
    self.send_delete_table_column_statistics(db_name, tbl_name, col_name)
    return self.recv_delete_table_column_statistics()
1125733
def alter_table(self, dbname, tbl_name, new_tbl):
    
    self.send_alter_table(dbname, tbl_name, new_tbl)
    self.recv_alter_table()