Appendix B. Drill Formatting Strings

Apache Drill uses Joda formatting strings for date and time formatting, as shown in Table B-1.

Table B-1. Number formatting characters
Symbol Location Meaning

0

Number

Digit.

#

Number

Digit, zero shows as absent.

.

Number

Decimal separator or monetary decimal separator.

-

Number

Minus sign.

,

Number

Grouping separator.

E

Number

Separates mantissa and exponent in scientific notation. Does not need to be quoted in prefix or suffix.

;

Subpattern boundary

Separates positive and negative subpatterns.

%

Prefix or suffix

Multiplies by 100 and shows as percentage.

(030)

Prefix or suffix

Multiplies by 1,000 and shows as per-mille value.

¤ (0A4)

Prefix or suffix

Currency sign, replaced by currency symbol. If doubled, replaced by international currency symbol. If present in a pattern, the monetary decimal separator is used instead of the decimal separator.

'

Prefix or suffix

Used to quote special characters in a prefix or suffix; for example, "'#'#"" formats 123 to ""#123"". To create a single quote itself, use two in a row: "# o''clock".

Drill uses the characters shown in Table B-2 for date formats. Note that these are case-sensitive.

Table B-2. Joda date formatting characters
Symbol Meaning Presentation Examples
G era text AD
C century of era (≥0) number 20
Y year of era (≥0) year 1996
x weekyear year 1996
w week of weekyear number 27

Get Learning Apache Drill now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.