timescaledb/src/compression_with_clause.h
Matvey Arye 6f22a7a68c Improve parsing of segment by and order by lists
Replace custom parsing of order by and segment by lists
with the postgres parser. The segment by list is now
parsed in the same way as the GROUP BY clause and the
order by list in the same way as the ORDER BY clause.

Also fix default for nulls first/last to follow the PG
convention: LAST for ASC, FIRST for DESC.
2019-10-29 19:02:58 -04:00

38 lines
1009 B
C

/*
* This file and its contents are licensed under the Apache License 2.0.
* Please see the included NOTICE for copyright information and
* LICENSE-APACHE for a copy of the license.
*/
#ifndef TIMESCALEDB_COMPRESSION_WITH_CLAUSE_H
#define TIMESCALEDB_COMPRESSION_WITH_CLAUSE_H
#include <postgres.h>
#include <catalog/pg_type.h>
#include <catalog.h>
#include <chunk.h>
#include "with_clause_parser.h"
typedef enum CompressHypertableOption
{
CompressEnabled = 0,
CompressSegmentBy,
CompressOrderBy,
} CompressHypertableOption;
typedef struct
{
short index;
NameData colname;
bool nullsfirst;
bool asc;
} CompressedParsedCol;
WithClauseResult *ts_compress_hypertable_set_clause_parse(const List *defelems);
extern TSDLLEXPORT List *ts_compress_hypertable_parse_segment_by(WithClauseResult *parsed_options,
Hypertable *hypertable);
extern TSDLLEXPORT List *ts_compress_hypertable_parse_order_by(WithClauseResult *parsed_options,
Hypertable *hypertable);
#endif