__all__ = [
    "REQUIRED_KEYWORDS",
    "KEYWORDS",
    "EXTENDED_KEYWORDS",
    "FUNCTIONS",
    "OPERATORS",
    "WORD_OPERATORS",
]


REQUIRED_KEYWORDS = [
    "FROM",
    "SELECT",
]


KEYWORDS = [
    *REQUIRED_KEYWORDS,
    # Keywords: Constants
    "NULL",
    "TRUE",
    "FALSE",
    # Keywords: time operators
    "THIS",
    "LAST",
    "AT",
    "AGO",
    # Keywords: relative time and days
    "NOW",
    "TODAY",
    "YESTERDAY",
    # Keywords: day names
    "MONDAY",
    "TUESDAY",
    "WEDNESDAY",
    "THURSDAY",
    "FRIDAY",
    "SATURDAY",
    "SUNDAY",
    # Keywords: time units
    "MILLISECOND",
    "MILLISECONDS",
    "SECOND",
    "SECONDS",
    "MINUTE",
    "MINUTES",
    "HOUR",
    "HOURS",
    "DAY",
    "DAYS",
    "WEEK",
    "WEEKS",
    "MONTH",
    "MONTHS",
    "QUARTER",
    "QUARTERS",
    "YEAR",
    "YEARS",
    # Keywords: clause tokens
    "SHOW",
    "EVENT",
    "TYPES",
    "DELETE",
    "FROM",
    "WITH",
    "INNER",
    "LEFT",
    "JOIN",
    "SELECT",
    "WHERE",
    "FACET",
    "CASES",
    "COMPARE",
    "EXTRAPOLATE",
    "LIMIT",
    "OFFSET",
    "ORDER",
    "BY",
    "ASC",
    "DESC",
    "SINCE",
    "UNTIL",
    "AUTO",
    "PREDICT",
    "TIMEZONE",
    "SLIDE",
    "TIMESERIES",
    "METRIC_FORMAT",
    "RAW",
]


EXTENDED_KEYWORDS = [
    *KEYWORDS,
    "USING",
]


FUNCTIONS = [
    # Keywords: aggregator functions
    "aggregationEndTime",
    "apdex",
    "average",
    "bucketPercentile",
    "cardinality",
    "cdfPercentage",
    "count",
    "derivative",
    "earliest",
    "filter",
    "funnel",
    "histogram",
    "keyset",
    "latest",
    "latestrate",
    "max",
    "median",
    "min",
    "percentage",
    "percentile",
    "predictLinear",
    "rate",
    "stdvar",
    "sum",
    "uniqueCount",
    "uniques",
    # Keywords: non-aggregator functions
    "accountId",
    "aparse",
    "blob",
    "buckets",
    "capture",
    "cidrAddress",
    "concat",
    "contains",
    "convert",
    "decode",
    "dimensions",
    "encode",
    "eventType",
    "getCdfCount",
    "getField",
    "if",
    "jparse",
    "length",
    "lookup",
    "lower",
    "mapKeys",
    "mapValues",
    "mod",
    "position",
    "round",
    "stddev",
    "substring",
    "toDatetime",
    "toTimestamp",
    "upper",
    # Keywords: date and time functions
    "dateOf",
    "dayOfMonthOf",
    "daysInMonthOf",
    "hourOf",
    "minuteOf",
    "monthOf",
    "quarterOf",
    "weekdayOf",
    "weekOf",
    "yearOf",
    # Keywords: mathematical functions
    "abs",
    "ceil",
    "clamp_max",
    "clamp_min",
    "exp",
    "floor",
    "ln",
    "log",
    "log10",
    "log2",
    "pow",
    "sqrt",
    # Keywords: casting functions
    "boolean",
    "numeric",
    "string",
    "tuple",
]


OPERATORS = [
    r"*",
    r"=",
    r"+",
    r"-",
    r"/",
    r"%",
    r".",
    r"<",
    r">",
    r"<=",
    r">=",
    r"!=",
]


WORD_OPERATORS = [
    "AND",
    "AS",
    "IN",
    "IS",
    "LIKE",
    "NOT",
    "ON",
    "OR",
    "RLIKE",
]
