ClickHouse/src/Parsers/ASTOrderByElement.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.0 KiB
C++
Raw Normal View History

2011-09-04 05:14:52 +00:00
#pragma once
#include <Parsers/IAST.h>
2016-11-20 12:43:20 +00:00
2011-09-04 05:14:52 +00:00
namespace DB
{
/** Element of expression with ASC or DESC,
* and possibly with COLLATE.
2011-09-04 05:14:52 +00:00
*/
class ASTOrderByElement : public IAST
{
public:
int direction = 0; /// 1 for ASC, -1 for DESC
int nulls_direction = 0; /// Same as direction for NULLS LAST, opposite for NULLS FIRST.
bool nulls_direction_was_explicitly_specified = false;
2019-04-23 01:48:51 +00:00
/** Collation for locale-specific string comparison. If empty, then sorting done by bytes. */
ASTPtr collation;
bool with_fill = false;
ASTPtr fill_from;
ASTPtr fill_to;
ASTPtr fill_step;
String getID(char) const override { return "OrderByElement"; }
2018-05-18 18:30:02 +00:00
ASTPtr clone() const override
{
auto clone = std::make_shared<ASTOrderByElement>(*this);
clone->cloneChildren();
return clone;
}
2023-11-10 12:15:23 +00:00
void updateTreeHashImpl(SipHash & hash_state, bool ignore_aliases) const override;
2020-08-20 02:01:40 +00:00
protected:
2016-11-20 12:43:20 +00:00
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
2011-09-04 05:14:52 +00:00
};
2011-09-04 05:14:52 +00:00
}