mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 11:03:36 +08:00
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.
38 lines
1009 B
C
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
|