当前位置: 首页>>代码示例>>Python>>正文


Python conf.APPLY_NATURAL_SORT_MAX类代码示例

本文整理汇总了Python中beeswax.conf.APPLY_NATURAL_SORT_MAX的典型用法代码示例。如果您正苦于以下问题:Python APPLY_NATURAL_SORT_MAX类的具体用法?Python APPLY_NATURAL_SORT_MAX怎么用?Python APPLY_NATURAL_SORT_MAX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了APPLY_NATURAL_SORT_MAX类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_tables

 def get_tables(self, database='default', table_names='*', table_types=None):
   if self.server_name == 'beeswax':
     identifier = self.to_matching_wildcard(table_names)
   else:
     identifier = None
   tables = self.client.get_tables(database, identifier, table_types)
   if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
     tables = apply_natural_sort(tables)
   return tables
开发者ID:gorden2,项目名称:hue,代码行数:9,代码来源:dbms.py

示例2: get_tables_meta

 def get_tables_meta(self, database="default", table_names="*", table_types=None):
     if self.server_name == "beeswax":
         identifier = self.to_matching_wildcard(table_names)
     else:
         identifier = None
     tables = self.client.get_tables_meta(database, identifier, table_types)
     if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
         tables = apply_natural_sort(tables, key="name")
     return tables
开发者ID:fnerdwq,项目名称:hue,代码行数:9,代码来源:dbms.py

示例3: get_databases

  def get_databases(self, database_names='*'):
    if database_names != '*':
      database_names = self.to_matching_wildcard(database_names)

    databases = self.client.get_databases(schemaName=database_names)

    if len(databases) <= APPLY_NATURAL_SORT_MAX.get():
      databases = apply_natural_sort(databases)

    return databases
开发者ID:gorden2,项目名称:hue,代码行数:10,代码来源:dbms.py

示例4: get_tables_meta

  def get_tables_meta(self, database='default', table_names='*', table_types=None):
    database = database.lower() # Impala is case sensitive

    if self.server_name == 'beeswax':
      identifier = self.to_matching_wildcard(table_names)
    else:
      identifier = None
    tables = self.client.get_tables_meta(database, identifier, table_types)
    if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
      tables = apply_natural_sort(tables, key='name')
    return tables
开发者ID:10sr,项目名称:hue,代码行数:11,代码来源:dbms.py

示例5: get_databases

  def get_databases(self, database_names='*'):
    identifier = self.to_matching_wildcard(database_names)

    hql = "SHOW DATABASES LIKE '%s'" % (identifier) # self.client.get_databases() is too slow
    query = hql_query(hql)
    timeout = SERVER_CONN_TIMEOUT.get()

    handle = self.execute_and_wait(query, timeout_sec=timeout)

    if handle:
      result = self.fetch(handle, rows=5000)
      self.close(handle)
      databases = [name for database in result.rows() for name in database]
      if len(databases) <= APPLY_NATURAL_SORT_MAX.get():
        databases = apply_natural_sort(databases)
      return databases
    else:
      return []
开发者ID:cloudnautique,项目名称:hue,代码行数:18,代码来源:dbms.py

示例6: get_tables

  def get_tables(self, database='default', table_names='*'):
    identifier = self.to_matching_wildcard(table_names)

    hql = "SHOW TABLES IN `%s` '%s'" % (database, identifier) # self.client.get_tables(database, table_names) is too slow
    query = hql_query(hql)
    timeout = SERVER_CONN_TIMEOUT.get()

    handle = self.execute_and_wait(query, timeout_sec=timeout)

    if handle:
      result = self.fetch(handle, rows=5000)
      self.close(handle)
      tables = [name for table in result.rows() for name in table]
      if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
        tables = apply_natural_sort(tables)
      return tables
    else:
      return []
开发者ID:GitHublong,项目名称:hue,代码行数:18,代码来源:dbms.py

示例7: get_tables

  def get_tables(self, database='default', table_names='*'):
    identifier = self.to_matching_wildcard(table_names)
    identifier = "'%s'" % identifier if identifier != '*' else '' # Filter not supported in SparkSql

    hql = "SHOW TABLES IN `%s` %s" % (database, identifier) # self.client.get_tables(database, table_names) is too slow
    query = hql_query(hql)
    timeout = SERVER_CONN_TIMEOUT.get()

    handle = self.execute_and_wait(query, timeout_sec=timeout)

    if handle:
      result = self.fetch(handle, rows=5000)
      self.close(handle)
      tables = [table[0] for table in result.rows()] # We only keep the first column as the name, SparkSql returns multiple columns
      if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
        tables = apply_natural_sort(tables)
      return tables
    else:
      return []
开发者ID:cloudnautique,项目名称:hue,代码行数:19,代码来源:dbms.py

示例8: get_tables_meta

 def get_tables_meta(self, database='default', table_names='*'):
   identifier = self.to_matching_wildcard(table_names)
   tables = self.client.get_tables_meta(database, identifier)
   if len(tables) <= APPLY_NATURAL_SORT_MAX.get():
     tables = apply_natural_sort(tables, key='name')
   return tables
开发者ID:cloudnautique,项目名称:hue,代码行数:6,代码来源:dbms.py


注:本文中的beeswax.conf.APPLY_NATURAL_SORT_MAX类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。