SqlUtils

com.netflix.atlas.postgres.SqlUtils
object SqlUtils

Utilities for working with tables.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SqlUtils.type

Members list

Value members

Concrete methods

def addNaN: String

Add operation to use as part of sum aggregation.

Add operation to use as part of sum aggregation.

Attributes

def aggrCount: String

Count aggregation for an array of values.

Count aggregation for an array of values.

Attributes

def aggrMax: String

Max aggregation for an array of values.

Max aggregation for an array of values.

Attributes

def aggrMin: String

Min aggregation for an array of values.

Min aggregation for an array of values.

Attributes

def aggrSum: String

Sum aggregation for an array of values.

Sum aggregation for an array of values.

Attributes

def arrayAdd: String

Add corresponding elements of two arrays.

Add corresponding elements of two arrays.

Attributes

def arrayCount: String

Count corresponding elements of two arrays.

Count corresponding elements of two arrays.

Attributes

def arrayMax: String

Compute max of corresponding elements of two arrays.

Compute max of corresponding elements of two arrays.

Attributes

def arrayMin: String

Compute min of corresponding elements of two arrays.

Compute min of corresponding elements of two arrays.

Attributes

def arrayZeroToNull: String

Convert zero values in an array to nulls. Used with count aggregation.

Convert zero values in an array to nulls. Used with count aggregation.

Attributes

def createSchema: String
def createTable(config: TableDefinition, time: Instant): String

Create a table if not already present.

Create a table if not already present.

Value parameters

config

Configuration for the table schema.

time

Time suffix to use for the table. Typically tables will be used for a range of time and then deleted entirely when past the retention window.

Attributes

def customFunctions: List[String]

Set of custom functions to simplify usage.

Set of custom functions to simplify usage.

Attributes

def dataQueries(time: Instant, tables: List[TableDefinition], expr: DataExpr): List[String]

Return a set of data queries for an ASL expression.

Return a set of data queries for an ASL expression.

Value parameters

expr

Tag query to map to SQL.

tables

Set of tables defined.

time

Timestamp of interest for the current context.

Attributes

Returns

Set of SQL queries to evaluate a data expression.

def extractTime(table: String): Option[Instant]

Extract the time based on the suffix for the table name.

Extract the time based on the suffix for the table name.

Attributes

def keyQueries(time: Instant, tables: List[TableDefinition], tq: TagQuery): List[String]

Return a set of key queries for an ASL query expression.

Return a set of key queries for an ASL query expression.

Value parameters

tables

Set of tables defined.

time

Timestamp of interest for the current context.

tq

Tag query to map to SQL.

Attributes

Returns

Set of SQL queries to lookup the keys.

def listTables: String
def maxNaN: String

Max operation to use as part of aggregation.

Max operation to use as part of aggregation.

Attributes

def minNaN: String

Min operation to use as part of aggregation.

Min operation to use as part of aggregation.

Attributes

def toSuffix(time: Instant): String

Convert the time to a suffix string that will be used on the table name.

Convert the time to a suffix string that will be used on the table name.

Attributes

def union(queries: List[String]): String
def unionAll(queries: List[String]): String
def valueQueries(time: Instant, tables: List[TableDefinition], tq: TagQuery): List[String]

Return a set of value queries for an ASL query expression.

Return a set of value queries for an ASL query expression.

Value parameters

tables

Set of tables defined.

time

Timestamp of interest for the current context.

tq

Tag query to map to SQL.

Attributes

Returns

Set of SQL queries to lookup the values.