prestoonlyvarchars.properties 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. #Licensed Materials - Property of IBM
  2. #
  3. #OCO Source Materials
  4. #
  5. #BI and PM: rdbmscert
  6. #
  7. #(C) Copyright IBM Corp. 2009,2020
  8. #
  9. #US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM corp.
  10. #This properties file contains default configuration attributes for all
  11. #
  12. #relational data sources. Any data source that is different must override
  13. #
  14. #the value in their own properties file.
  15. #
  16. #
  17. # *ONLY* us this file if a Presto users knows for a fact that their underlying data only uses varchar types and not fixed length (char)
  18. # types. Presto does not corrrectly compute string comparisons that involved fixed length character types. This can result in
  19. # queries returning incorrect results.
  20. #
  21. # Fix length operations will not be pushed to Presto
  22. # Where Presto incorrectly describes the type/precision of a fixed length column/value expressions it will be interpreted as a varchar
  23. # type which prevents decomposition specific to char types
  24. #
  25. # This file will not include pessimistic expressions which force rtrim(cast( as varchar)) around those items which may result
  26. # slower performance
  27. #
  28. #
  29. # Delimiters
  30. #
  31. # While a vendor may parse a statement with comments it may strip them out and the server not see them
  32. delimiters.commentBegin=/*
  33. delimiters.commentEnd=*/
  34. # delimiters.catalogDelimiter=
  35. # delimiters.schemaDelimiter=
  36. # delimiters.tableDelimiter=
  37. # delimiters.columnDelimiter=
  38. # delimiters.identifierQuoteString=
  39. # delimiters.searchStringEscape=
  40. # delimiters.catalogSeparator=
  41. #
  42. # Keywords
  43. #
  44. keywords.columnAlias=AS
  45. #
  46. # Limits
  47. #
  48. # Normally these values would be derived from the JDBC driver DatabaseMetadata
  49. # limits.maxBinaryLiteralLength=
  50. # limits.maxCharLiteralLength=
  51. # limits.maxColumnNameLength=
  52. # limits.maxColumnsInGroupBy=
  53. # limits.maxColumnsInIndex=
  54. # limits.maxColumnsInOrderBy=
  55. # limits.maxColumnsInSelect=
  56. # limits.maxColumnsInTable=
  57. # limits.maxConnections=
  58. # limits.maxCursorNameLength=
  59. # limits.maxIndexLength=
  60. # limits.maxSchemaNameLength=
  61. # limits.maxProcedureNameLength=
  62. # limits.maxCatalogNameLength=
  63. # limits.maxRowSize=
  64. # limits.maxStatementLength=
  65. limits.maxStatements=1
  66. # limits.maxTableNameLength=
  67. # limits.maxTablesInSelect=
  68. # limits.maxUserNameLength=
  69. # limits.defaultTransactionIsolation=
  70. # limits.maxLengthInClause
  71. #
  72. # General
  73. #
  74. #
  75. # Null ordering
  76. #
  77. # No support is provided for vendors who change how nulls sort based on data type.
  78. general.nullsAreSortedHigh=true
  79. general.nullsAreSortedLow=false
  80. general.nullsAreSortedAtStart=false
  81. general.nullsAreSortedAtEnd=true
  82. general.nullsOrdering=true
  83. general.nullsOrderingInWindowSpecification=true
  84. # supports.hints=false
  85. supports.constantsInWindows=true
  86. # Cursor options - appended to end of generated SELECT statement.
  87. general.cursorOptions=
  88. #
  89. # Various
  90. #
  91. supports.duplicateColumnsInSelectList=true
  92. supports.columnAliasing=true
  93. supports.tableCorrelationNames=true
  94. supports.expressionsInSelectList=true
  95. supports.expressionsInINPredicate=true
  96. supports.expressionsInOrderBy=true
  97. supports.literalsInSelectList=true
  98. supports.booleanExpressionsInSelectList=true
  99. supports.fieldsOfComplexTypeInSelectList=false
  100. supports.likeEscapeClause=true
  101. supports.outerJoins=true
  102. supports.fullOuterJoins=true
  103. supports.subqueriesInComparisons=true
  104. supports.subqueriesInExists=true
  105. # Due to presto throwing errors re NULL values are not allowed on the probe side of SemiJoin operator
  106. supports.subqueriesInIns=false
  107. # Presto computes incorrect results
  108. supports.subqueriesInQuantifieds=false
  109. supports.subqueriesInOnClause=true
  110. supports.subqueriesInCase=true
  111. supports.subqueriesInAggregate=true
  112. # Due to various presto limitations
  113. supports.correlatedSubqueries=false
  114. supports.correlatedSubqueriesInSelectList=false
  115. supports.correlatedSubqueriesInIns=false
  116. supports.scalarSubqueries=true
  117. supports.withClauseInDerivedTable=true
  118. supports.nestedWithClause=true
  119. supports.integerDivision=true
  120. supports.nestedOlap=false
  121. supports.derivedColumnLists=true
  122. supports.orderByAlias=true
  123. supports.orderByName=true
  124. supports.orderByOrdinal=true
  125. supports.blobsInGroupBy=false
  126. supports.blobsInOrderBy=false
  127. supports.transactions=false
  128. # Results for other scalar, aggregate and set operations will differ from DQM/ISO-SQL.
  129. supports.emptyStringIsNull=false
  130. supports.expressionsInGroupBy=true
  131. supports.expressionsInOrderBy=true
  132. supports.expressionsInLikePattern=true
  133. supports.aliasInOrderByExpression=false
  134. supports.orderByUnrelated=true
  135. supports.groupByUnrelated=false
  136. supports.thetaJoins=true
  137. supports.equiJoins=true
  138. supports.crossProducts=true
  139. supports.multipleDistinctAggregates=false
  140. supports.recursiveWithClause=false
  141. supports.rowNumberNoOrderBy=true
  142. supports.parameterMarkers=false
  143. supports.constantsInWindows=true
  144. supports.orderByInDerivedTable=true
  145. supports.callProcedureInDerivedTable=false
  146. # Cannot use parameter markers in subquery
  147. supports.orderByInDerivedTable=true
  148. #join condition
  149. supports.join.betweenInOnClause=true
  150. supports.join.inPredicateInOnClause=true
  151. supports.join.isNullInOnClause=true
  152. supports.join.likeInOnClause=true
  153. supports.join.notInOnClause=true
  154. supports.join.orInOnClause=true
  155. supports.join.subqueriesInOnClause=true
  156. supports.join.onlyEquiWithAnd=false
  157. supports.join.inner.limitedThetaJoins=false
  158. supports.join.outer.thetaJoins=true
  159. supports.join.full.thetaJoins=true
  160. supports.join.full.distinctJoins=true
  161. #isolation level support
  162. supports.isolationLevelReadUncommitted=false
  163. supports.isolationLevelReadCommitted=false
  164. supports.isolationLevelRepeatableRead=false
  165. supports.isolationLevelSerializable=false
  166. supports.constantsInCount=true
  167. supports.columnFiltersOnly=false
  168. supports.hanaInputParameters=false
  169. supports.mixedCaseIdentifiers=false
  170. supports.mixedCaseQuotedIdentifiers=false
  171. supports.formatters.string_to_date=false
  172. supports.formatters.string_to_time=false
  173. supports.formatters.string_to_time_with_time_zone=false
  174. supports.formatters.string_to_timestamp=false
  175. supports.formatters.string_to_timestamp_with_time_zone=false
  176. #
  177. # Grouping query optimization
  178. #
  179. # If the RDBMS has costing/execution issues with group by or distinct consider these transforms
  180. performance.convertGroupByToDistinct=false
  181. performance.convertDistinctToGroupBy=false
  182. # V5 master-detail optimization when allRows optimization is specified
  183. v5.master-detail.transform=false
  184. performance.convertHavingToWhere=false
  185. performance.transitiveClosure=false
  186. performance.predicatePushdown=false
  187. performance.semiJoin=false
  188. # RTC 377496
  189. # Set this entry to F to avoid generation of predicates of the form
  190. # T1.C1 = T2.C1 OR ( T1.C1 IS NULL AND T2.C1 IS NULL ). Care must be
  191. # taken, however, since doing so may cause data integrity problems if
  192. # data contains null values.
  193. performance.generateEqualOrNull=true
  194. #
  195. # Commands
  196. #
  197. commands.Select=SELECT
  198. commands.Call=
  199. #
  200. # Tables
  201. #
  202. tables.joined=true
  203. tables.derived=true
  204. tables.lateral.derived=false
  205. #
  206. # Constructors
  207. #
  208. constructors.table=true
  209. constructors.row=false
  210. constructors.array=true
  211. constructors.period=false
  212. constructors.map=false
  213. #
  214. # Constructors - context overrides.
  215. #
  216. constructors.row.simpleCase=true
  217. constructors.row.between=false
  218. constructors.row.isDistinctFrom=false
  219. constructors.row.inListToTable=false
  220. #
  221. # Clauses
  222. #
  223. clauses.From=FROM
  224. clauses.Where=WHERE
  225. clauses.GroupBy=GROUP BY
  226. clauses.Having=HAVING
  227. clauses.WithRecursive=
  228. clauses.With=WITH
  229. clauses.OrderBy=ORDER BY
  230. clauses.Distinct=DISTINCT
  231. clauses.Top=LIMIT %1$s
  232. clauses.At=
  233. clauses.Window=
  234. clauses.TableSampleSystem=
  235. clauses.TableSampleBernoulli=
  236. clauses.ForSystemTimeAsOf=
  237. clauses.ForSystemTimeFrom=
  238. clauses.ForSystemTimeBetween=
  239. #
  240. # Joins
  241. #
  242. joins.Cross=%1$s CROSS JOIN %2$s
  243. joins.Inner=%1$s INNER JOIN %2$s ON %3$s
  244. joins.LeftOuter=%1$s LEFT OUTER JOIN %2$s ON %3$s
  245. joins.RightOuter=%1$s RIGHT OUTER JOIN %2$s ON %3$s
  246. joins.FullOuter=%1$s FULL OUTER JOIN %2$s ON %3$s
  247. joins.RightNested=%1$s
  248. #
  249. # Set Operators
  250. #
  251. # One or more set operations does not follow ISO data type combination rules. Can effect set operations, CASE, COALESCE...
  252. operators.set.Union=%1$s UNION %2$s
  253. operators.set.Union.all=%1$s UNION ALL %2$s
  254. operators.set.Intersect=%1$s INTERSECT %2$s
  255. operators.set.Intersect.all=
  256. operators.set.Except=%1$s EXCEPT %2$s
  257. operators.set.Except.all=
  258. #
  259. # Logical Operators
  260. #
  261. operators.logical.And=%1$s AND %2$s
  262. operators.logical.Or=%1$s OR %2$s
  263. operators.logical.Not=NOT ( %1$s )
  264. operators.logical.Is=
  265. operators.logical.IsNot=
  266. operators.logical.IsJson=
  267. operators.logical.IsNotJson=
  268. #
  269. # Arithmetic and Character operators
  270. #
  271. # Division may return a precise type if expression not coerced to imprecise type
  272. operators.arithmetic.Add[any,any]=%1$s + %2$s
  273. operators.arithmetic.Subtract[any,datetime]=
  274. operators.arithmetic.Subtract[datetime,any]=
  275. operators.arithmetic.Subtract[any,numeric]=%1$s - %2$s
  276. operators.arithmetic.Multiply[any,any]=%1$s * %2$s
  277. operators.arithmetic.Divide[any,any]=%1$s / %2$s
  278. operators.arithmetic.UnaryPlus[any]=+%1$s
  279. operators.arithmetic.Negate[any]=-%1$s
  280. operators.arithmetic.Concat[any,any]=%1$s || %2$s
  281. #
  282. # Grouping Operators
  283. #
  284. operators.groupBy.Rollup=ROLLUP
  285. operators.groupBy.Cube=CUBE
  286. operators.groupBy.GroupingSets=
  287. #
  288. # Comparison Predicates
  289. #
  290. predicates.comparison.Equals[any,any]=%1$s = %2$s
  291. # due to Presto not correctly supporting character types in comparisons
  292. predicates.comparison.Equals[char,any]=
  293. predicates.comparison.Equals[any,char]=
  294. predicates.comparison.GreaterThan[any,any]=%1$s > %2$s
  295. # due to Presto not correctly supporting character types in comparisons
  296. predicates.comparison.GreaterThan[char,any]=
  297. predicates.comparison.GreaterThan[any,char]=
  298. predicates.comparison.GreaterThanOrEquals[any,any]=%1$s >= %2$s
  299. # due to Presto not correctly supporting character types in comparisons
  300. predicates.comparison.GreaterThanOrEquals[char,any]=
  301. predicates.comparison.GreaterThanOrEquals[any,char]=
  302. predicates.comparison.LessThan[any,any]=%1$s < %2$s
  303. # due to Presto not correctly supporting character types in comparisons
  304. predicates.comparison.LessThan[char,any]=
  305. predicates.comparison.LessThan[any,char]=
  306. predicates.comparison.LessThanOrEquals[any,any]=%1$s <= %2$s
  307. # due to Presto not correctly supporting character types in comparisons
  308. predicates.comparison.LessThanOrEquals[char,any]=
  309. predicates.comparison.LessThanOrEquals[any,char]=
  310. predicates.comparison.NotEquals[any,any]=%1$s <> %2$s
  311. # due to Presto not correctly supporting character types in comparisons
  312. predicates.comparison.NotEquals[char,any]=
  313. predicates.comparison.NotEquals[any,char]=
  314. #
  315. # Predicates
  316. #
  317. predicates.Between[any,any,any]=%1$s BETWEEN %2$s AND %3$s
  318. # due to Presto not correctly supporting character types in comparisons
  319. predicates.Between[char,any,any]=
  320. predicates.Between[any,char,any]=
  321. predicates.Between[any,any,char]=
  322. predicates.In[any,any]=%1$s IN ( %2$s )
  323. # due to Presto not correctly supporting character types in comparisons
  324. predicates.In[char,any]=
  325. predicates.In[any,char]=
  326. predicates.Overlaps[any,any,any,any]=
  327. predicates.IsNull[any]=%1$s IS NULL
  328. predicates.IsNotNull[any]=%1$s IS NOT NULL
  329. predicates.Like=%1$s LIKE %2$s
  330. predicates.Like.escape=%1$s LIKE %2$s ESCAPE %3$s
  331. predicates.LikeRegex=%1$s LIKE_REGEX %2$s
  332. predicates.LikeRegex.flag=
  333. predicates.Similar=
  334. predicates.Similar.escape=
  335. predicates.Exists=EXISTS %1$s
  336. # Presto computes incorrect results with quantified predicate and subquery
  337. predicates.All=
  338. predicates.Any=
  339. predicates.Some=
  340. predicates.IsDistinctFrom[any,any]=%1$s IS DISTINCT FROM %2$s
  341. # due to Presto limitations on comparisons using fix length types
  342. predicates.IsDistinctFrom[char,any]=
  343. predicates.IsDistinctFrom[any,char]=
  344. # due to Presto presto throwing type error
  345. predicates.IsDistinctFrom[varchar,varchar]=(%1$s IS NULL AND %2$s IS NOT NULL) OR (%1$s IS NOT NULL AND %2$s IS NULL) OR %1$s <> %2$s
  346. predicates.IsDistinctFrom[varchar,varchar]=(%1$s IS NULL AND %2$s IS NOT NULL) OR (%1$s IS NOT NULL AND %2$s IS NULL) OR %1$s <> %2$s
  347. predicates.IsNotDistinctFrom[any,any]=%1$s IS NOT DISTINCT FROM %2$s
  348. # due to Presto not correctly supporting character types in comparisons
  349. predicates.IsNotDistinctFrom[char,any]=
  350. predicates.IsNotDistinctFrom[any,char]=
  351. #
  352. # Period predicates.
  353. #
  354. predicates.PeriodOverlaps[any,any]=
  355. predicates.PeriodEquals[any,any]=
  356. predicates.PeriodContains[any,any]=
  357. predicates.PeriodPrecedes[any,any]=
  358. predicates.PeriodSucceeds[any,any]=
  359. predicates.PeriodImmediatelyPrecedes[any,any]=
  360. predicates.PeriodImmediatelySucceeds[any,any]=
  361. #
  362. # Expressions
  363. #
  364. expressions.ArrayElementRef.zeroBased=false
  365. #
  366. # Conditional expressions
  367. #
  368. expressions.SimpleCase=CASE
  369. expressions.SearchedCase=CASE
  370. # Minimum number of arguments for Coalesce function.
  371. expressions.Coalesce.minArgs=1
  372. expressions.Coalesce=
  373. expressions.NullIf=NULLIF(%1$s, %2$s)
  374. #
  375. # Cast
  376. #
  377. # Cannot cast from null value to Float
  378. # Cannot cast from null value to TimestampWithTZ
  379. # presto 0.160 not accepting char source types
  380. # presto 0.160 not accepting char as a target type
  381. # presto 0.160 not accepting time zone bearing types as target type
  382. # presto 0.160 not accepting intervals as a target type
  383. # presto 0.170 not supporting cast to bigint or smallint
  384. expressions.Cast[any,any]=CAST(%1$s AS %2$s)
  385. expressions.Cast[any,float]=
  386. expressions.Cast[float,any]=
  387. expressions.Cast[any,char]=
  388. expressions.Cast[char,any]=
  389. expressions.Cast[text,smallint]=cast(rtrim(cast(%1$s as varchar)) as smallint)
  390. expressions.Cast[text,integer]=cast(rtrim(cast(%1$s as varchar)) as integer)
  391. expressions.Cast[text,long]=cast(rtrim(cast(%1$s as varchar)) as bigint)
  392. expressions.Cast[double,varchar]=
  393. expressions.Cast[time,timestamp]=
  394. expressions.Cast[any,interval_day_time]=
  395. expressions.Cast[any,interval_year_month]=
  396. expressions.Cast[any,time_with_time_zone]=
  397. expressions.Cast[any,timestamp_with_time_zone]=
  398. #
  399. # Extract
  400. #
  401. expressions.Extract.YEAR[any]=EXTRACT(YEAR FROM %1$s)
  402. expressions.Extract.MONTH[any]=EXTRACT(MONTH FROM %1$s)
  403. expressions.Extract.DAY[any]=EXTRACT(DAY FROM %1$s)
  404. expressions.Extract.HOUR[any]=EXTRACT(HOUR FROM %1$s)
  405. expressions.Extract.MINUTE[any]=EXTRACT(MINUTE FROM %1$s)
  406. expressions.Extract.SECOND[any]=
  407. expressions.Extract.TIMEZONE_HOUR[any]=
  408. expressions.Extract.TIMEZONE_MINUTE[any]=
  409. expressions.Extract.EPOCH[any]=
  410. #
  411. # Trim
  412. #
  413. expressions.Trim.BOTH[any]=TRIM(%1$s)
  414. expressions.Trim.BOTH[any,any]=
  415. expressions.Trim.LEADING[any]=LTRIM(%1$s)
  416. expressions.Trim.LEADING[any,any]=
  417. expressions.Trim.TRAILING[any]=RTRIM(%1$s)
  418. expressions.Trim.TRAILING[any,any]=
  419. #
  420. # Windowed aggregates (SQL/OLAP).
  421. #
  422. # presto 0.160 does not support sum or avg of interval types
  423. olap.Max[any]=MAX(%1$s)
  424. olap.Min[any]=MIN(%1$s)
  425. olap.Sum[any]=SUM(%1$s)
  426. olap.Sum[interval_year_month]=
  427. olap.Sum[interval_day_time]=
  428. olap.Avg[any]=AVG(%1$s)
  429. olap.Avg[interval_year_month]=
  430. olap.Avg[interval_day_time]=
  431. olap.Count[any]=COUNT(%1$s)
  432. olap.CountStar[]=COUNT(*)
  433. olap.StdDevPop[any]=
  434. olap.StdDevSamp[any]=
  435. olap.VarPop[any]=
  436. olap.VarSamp[any]=
  437. olap.Rank[]=RANK()
  438. olap.DenseRank[]=DENSE_RANK()
  439. olap.CumeDist[]=CUME_DIST()
  440. olap.PercentileCont[any,any]=
  441. olap.PercentileDisc[any,any]=
  442. olap.PercentRank[]=PERCENT_RANK()
  443. olap.RatioToReport[any]=
  444. olap.Median[any]=
  445. olap.RowNumber[]=ROW_NUMBER()
  446. olap.Difference[any]=
  447. olap.FirstValue[any]=FIRST_VALUE(%1$s)
  448. olap.LastValue[any]=LAST_VALUE(%1$s)
  449. # Olap Ntile without an order by will sort nulls first and not last.
  450. olap.NTile[any]=NTILE(%1$s)
  451. olap.Tertile[]=
  452. olap.Lag[any]=LAG(%1$s)
  453. olap.Lag[any,any]=LAG(%1$s, cast( floor(%2$s) as integer))
  454. olap.Lag[any,any,any]=LAG(%1$s, cast( floor(%2$s) as integer), %3$s)
  455. olap.Lag[any,any,any,any]=
  456. olap.Lead[any]=LEAD(%1$s)
  457. olap.Lead[any,any]=LEAD(%1$s, cast( floor(%2$s) as integer))
  458. olap.Lead[any,any,any]=LEAD(%1$s, cast( floor(%2$s) as integer), %3$s)
  459. olap.Lead[any,any,any,any]=
  460. olap.NthValue[any,any]=NTH_VALUE(%1$s, cast( floor(%2$s) as integer))
  461. olap.NthValue[any,any,any]=
  462. olap.NthValue[any,any,any,any]=
  463. olap.Collect[any]=
  464. #
  465. # Window clause
  466. #
  467. olap.Window=
  468. olap.PartitionBy=PARTITION BY %1$s
  469. olap.OrderBy=ORDER BY %1$s
  470. #
  471. # Window specification
  472. #
  473. olap.Window.Specification[POF]=true
  474. olap.Window.Specification[PF]=true
  475. olap.Window.Specification[OF]=true
  476. olap.Window.Specification[PO]=true
  477. olap.Window.Specification[P]=true
  478. olap.Window.Specification[O]=true
  479. olap.Window.Specification[F]=true
  480. olap.Window.Specification[]=true
  481. #
  482. # Olap Distinct
  483. #
  484. olap.Min.distinct[any]=
  485. olap.Max.distinct[any]=
  486. olap.Sum.distinct[any]=
  487. olap.Avg.distinct[any]=
  488. olap.Count.distinct[any]=
  489. #
  490. # Aggregates
  491. #
  492. # presto 0.160 does not support sum or avg of interval types
  493. aggregates.Max[any]=MAX(%1$s)
  494. # due to presto not returning max time
  495. aggregates.Max[time]=
  496. aggregates.Min[any]=MIN(%1$s)
  497. # due to presto not returning correct min time
  498. aggregates.Min[time]=
  499. aggregates.Count[any]=COUNT(%1$s)
  500. aggregates.CountStar[]=COUNT(*)
  501. aggregates.Sum[any]=SUM(%1$s)
  502. aggregates.Sum[interval_day_time]=
  503. aggregates.Sum[interval_year_month]=
  504. aggregates.Avg[any]=AVG(%1$s)
  505. aggregates.Avg[interval_day_time]=
  506. aggregates.Avg[interval_year_month]=
  507. aggregates.StdDevPop[any]=STDDEV_POP(%1$s)
  508. aggregates.StdDevSamp[any]=STDDEV_SAMP(%1$s)
  509. aggregates.VarPop[any]=VAR_POP(%1$s)
  510. aggregates.VarSamp[any]=VAR_SAMP(%1$s)
  511. aggregates.Rank[any,any]=
  512. aggregates.DenseRank[any,any]=
  513. aggregates.PercentRank[any,any]=PERCENT_RANK(%1$s) WITHIN GROUP (ORDER BY %2$s)
  514. aggregates.CumeDistH[any,any]=
  515. aggregates.PercentileDisc[any,any]=
  516. aggregates.PercentileCont[any,any]=
  517. aggregates.Median[any]=
  518. aggregates.Grouping[any]=
  519. aggregates.XMLAgg[any]=
  520. aggregates.ArrayAgg[any]=
  521. aggregates.ArrayAgg[any,any]=
  522. aggregates.Collect[any]=
  523. aggregates.ApproxCountDistinct[any]=APPROX_DISTINCT(%1$s)
  524. #
  525. # Distinct aggregates
  526. #
  527. # presto 0.160 does not support sum or avg of interval types
  528. aggregates.Avg.distinct[any]=AVG(DISTINCT %1$s)
  529. aggregates.Avg.distinct[interval_day_time]=
  530. aggregates.Avg.distinct[interval_year_month]=
  531. aggregates.Min.distinct[any]=MIN(DISTINCT %1$s)
  532. # due to presto returning wrong min value for time
  533. aggregates.Min.distinct[time]=
  534. aggregates.Max.distinct[any]=MAX(DISTINCT %1$s)
  535. # due to presto returning wrong max value for time
  536. aggregates.Max.distinct[time]=
  537. aggregates.Count.distinct[any]=COUNT(DISTINCT %1$s)
  538. aggregates.Sum.distinct[any]=SUM(DISTINCT %1$s)
  539. aggregates.Sum.distinct[interval_day_time]=
  540. aggregates.Sum.distinct[interval_year_month]=
  541. #
  542. # Linear regression aggregates
  543. #
  544. aggregates.Corr[any,any]=
  545. aggregates.CovarPop[any,any]=
  546. aggregates.CovarSamp[any,any]=
  547. aggregates.RegrAvgX[any,any]=
  548. aggregates.RegrAvgY[any,any]=
  549. aggregates.RegrCount[any,any]=
  550. aggregates.RegrIntercept[any,any]=
  551. aggregates.RegrR2[any,any]=
  552. aggregates.RegrSlope[any,any]=
  553. aggregates.RegrSXX[any,any]=
  554. aggregates.RegrSXY[any,any]=
  555. aggregates.RegrSYY[any,any]=
  556. #
  557. # JSON aggregates.
  558. #
  559. aggregates.JSONArrayAgg=
  560. aggregates.JSONObjectAgg=
  561. #
  562. # Character scalar functions
  563. #
  564. functions.CharLength[any]=LENGTH(%1$s)
  565. functions.OctetLength[any]=
  566. functions.BitLength[any]=
  567. functions.Upper[any]=UPPER(%1$s)
  568. functions.Lower[any]=LOWER(%1$s)
  569. functions.Substring[any,any]=SUBSTR(%1$s, cast( floor(%2$s) as integer))
  570. functions.Substring[any,any,any]=SUBSTR(%1$s, cast( floor(%2$s) as integer), cast( floor(%3$s) as integer))
  571. functions.Position[any,any]=POSITION(%1$s IN %2$s)
  572. functions.Index[any,any]=
  573. functions.Ascii[any]=
  574. functions.Translate[any,any]=
  575. functions.Normalize[any]=NORMALIZE(%1$s)
  576. functions.Normalize[any,any]=NORMALIZE(%1$s,%2$s)
  577. functions.Normalize[any,any,any]=
  578. #
  579. # Regular expression functions.
  580. #
  581. functions.SubstringRegex[any,any,any,any,any]=
  582. functions.OccurrencesRegex[any,any,any,any]=
  583. functions.PositionRegex[any,any,any,any,any,any]=
  584. #
  585. # Numeric scalar functions
  586. #
  587. functions.Abs[any]=ABS(%1$s)
  588. functions.Ceiling[any]=CEILING(%1$s)
  589. functions.Exp[any]=EXP(%1$s)
  590. functions.Floor[any]=FLOOR(%1$s)
  591. functions.Ln[any]=LN(%1$s)
  592. functions.Log10[any]=LOG10(%1$s)
  593. functions.Mod[any,any]=MOD(%1$s, %2$s)
  594. functions.Power[any,any]=POWER(%1$s, %2$s)
  595. functions.Random[]=RANDOM()
  596. functions.Random[any]=
  597. functions.Round[any]=ROUND(%1$s)
  598. functions.Round[any,any]=ROUND(%1$s, %2$s)
  599. functions.Round[any,any,any]=
  600. functions.Sign[any]=SIGN(%1$s)
  601. functions.Sqrt[any]=SQRT(%1$s)
  602. functions.WidthBucket[any,any,any,any]=WIDTH_BUCKET(%1$s, %2$s, %3$s, %4$s)
  603. #
  604. # Array scalar functions
  605. #
  606. functions.Cardinality[any]=
  607. functions.TrimArray[any,any]=
  608. #
  609. # Trig Functions
  610. #
  611. functions.Arccos[any]=ACOS(%1$s)
  612. functions.Cos[any]=COS(%1$s)
  613. functions.Coshyp[any]=COSH(%1$s)
  614. functions.Arcsin[any]=ASIN(%1$s)
  615. functions.Sin[any]=SIN(%1$s)
  616. functions.Sinhyp[any]=
  617. functions.Arctan[any]=ATAN(%1$s)
  618. functions.Tan[any]=TAN(%1$s)
  619. functions.Tanhyp[any]=TANH(%1$s)
  620. #
  621. # Temporal value expressions
  622. #
  623. # Note: JDBC does not define fractional seconds for TIME data type.
  624. functions.CurrentDate[]=CURRENT_DATE
  625. functions.CurrentTime[]=CURRENT_TIME
  626. functions.CurrentTime[numeric]=
  627. functions.CurrentTimestamp[]=CURRENT_TIMESTAMP
  628. functions.CurrentTimestamp[numeric]=
  629. functions.LocalTime[]=LOCALTIME
  630. functions.LocalTime[numeric]=
  631. functions.LocalTimestamp[]=LOCALTIMESTAMP
  632. functions.LocalTimestamp[numeric]=
  633. #
  634. # XML Functions
  635. #
  636. functions.XMLAttributes=
  637. functions.XMLComment=
  638. functions.XMLConcat=
  639. functions.XMLDocument=
  640. functions.XMLElement=
  641. functions.XMLExists=
  642. functions.XMLForest=
  643. functions.XMLNamespaces=
  644. functions.XMLParse=
  645. functions.XMLPI=
  646. functions.XMLQuery=
  647. functions.XMLSerialize=
  648. functions.XMLTable=
  649. functions.XMLText=
  650. functions.XMLTransform=
  651. functions.XMLValidate=
  652. functions.XMLElement.ContentOption.NULL_ON_NULL=false
  653. functions.XMLElement.ContentOption.EMPTY_ON_NULL=false
  654. functions.XMLForest.ContentOption.NULL_ON_NULL=false
  655. functions.XMLForest.ContentOption.EMPTY_ON_NULL=false
  656. functions.XMLParse.DocumentOrContent.DOCUMENT=false
  657. functions.XMLParse.DocumentOrContent.CONTENT=false
  658. functions.XMLParse.WhitespaceOption.STRIP_WHITESPACE=false
  659. functions.XMLParse.WhitespaceOption.PRESERVE_WHITESPACE=false
  660. functions.XMLQuery.EmptyHandlingOption.NULL_ON_EMPTY=true
  661. functions.XMLQuery.EmptyHandlingOption.EMPTY_ON_EMPTY=true
  662. functions.XMLSerialize.DeclarationOption.INCLUDING_XMLDECLARATION=false
  663. functions.XMLSerialize.DeclarationOption.EXCLUDING_XMLDECLARATION=false
  664. #
  665. # JSON functions.
  666. #
  667. functions.JSONObject=
  668. functions.JSONArray=
  669. functions.JSONExists=
  670. functions.JSONQuery=
  671. functions.JSONTable=
  672. functions.JSONValue=
  673. #
  674. # Business functions.
  675. #
  676. functions.AddHours[any,any]=DATE_ADD('hour',cast( floor(%2$s) as integer), %1$s)
  677. functions.AddMinutes[any,any]=DATE_ADD('minute',cast( floor(%2$s) as integer), %1$s)
  678. functions.AddSeconds[any,any]=DATE_ADD('second',cast( floor(%2$s) as integer), %1$s)
  679. functions.AddFractionalSeconds[any,any]=DATE_ADD('millisecond',cast( floor(%2$s) as integer), %1$s)
  680. functions.AddDays[any,any]=DATE_ADD('day',cast( floor(%2$s) as integer), %1$s)
  681. functions.AddWeeks[any,any]=DATE_ADD('week',cast( floor(%2$s) as integer), %1$s)
  682. functions.AddMonths[any,any]=
  683. functions.AddQuarters[any,any]=
  684. functions.AddYears[any,any]=DATE_ADD('year',cast( floor(%2$s) as integer), %1$s)
  685. functions.Age[any]=
  686. functions.FractionalSecondsBetween[any,any]=DATE_DIFF('millisecond', %1$s, %2$s)
  687. functions.SecondsBetween[any,any]=DATE_DIFF('second', %1$s, %2$s)
  688. functions.MinutesBetween[any,any]=DATE_DIFF('minute', %1$s, %2$s)
  689. functions.HoursBetween[any,any]=DATE_DIFF('hour', %1$s, %2$s)
  690. functions.DaysBetween[any,any]=DATE_DIFF('day', %1$s, %2$s)
  691. functions.WeeksBetween[any,any]=DATE_DIFF('week', %1$s, %2$s)
  692. functions.MonthsBetween[any,any]=
  693. functions.QuartersBetween[any,any]=
  694. functions.YearsBetween[any,any]=DATE_DIFF('year', %1$s, %2$s)
  695. functions.DayOfWeek[any,any]=
  696. functions.DayOfYear[any]=extract(day_of_year from %1$s)
  697. functions.DaysToEndOfMonth[any]=DATE_DIFF('day', %1$s, ((DATE_TRUNC('month', %1$s) + interval '1' month) - interval '1' day))
  698. functions.FirstOfMonth[any]=DATE_TRUNC('month', %1$s)
  699. functions.LastOfMonth[any]=((DATE_TRUNC('month', %1$s) + interval '1' month) - interval '1' day)
  700. functions.MakeTimestamp[any,any,any]=cast(cast(%1$s as interval year) + cast(%2$s as interval month) + cast(%3$s as day) as timestamp)
  701. functions.WeekOfYear[any]=WEEK_OF_YEAR(%1$s)
  702. functions.YMDIntBetween[any,any]=
  703. #
  704. # Table functions
  705. #
  706. functions.Unnest=
  707. #
  708. # Literals
  709. #
  710. literals.smallint=true
  711. literals.decimal=true
  712. literals.float=true
  713. literals.char=true
  714. literals.nchar=false
  715. literals.varchar=true
  716. literals.nvarchar=false
  717. literals.blob=false
  718. literals.clob=false
  719. literals.nclob=false
  720. literals.date=true
  721. literals.time=true
  722. literals.time_with_time_zone=false
  723. literals.timestamp=true
  724. literals.timestamp_with_time_zone=true
  725. # while Presto accepts interval literals it only describes two types y-m and d-s
  726. literals.interval_year=false
  727. literals.interval_month=false
  728. literals.interval_year_to_month=true
  729. literals.interval_day=false
  730. literals.interval_hour=false
  731. literals.interval_minute=false
  732. literals.interval_second=false
  733. literals.interval_day_to_hour=false
  734. literals.interval_day_to_minute=false
  735. literals.interval_day_to_second=true
  736. literals.interval_hour_to_minute=false
  737. literals.interval_hour_to_second=false
  738. literals.interval_minute_to_second=false
  739. literals.date=true
  740. literals.time=true
  741. literals.time_with_time_zone=true
  742. literals.timestamp=true
  743. literals.timestamp_with_time_zone=true
  744. literals.binary=false
  745. literals.boolean=false
  746. literals.xml=false
  747. literals.datalink=false
  748. literals.array=false
  749. literals.perioddate=false
  750. # Literal format specifications. Formats are compatible with String.format().
  751. # Values for default behaviour are listed.
  752. # Only char, temporal and string types can be overridden.
  753. # Fractional seconds are presented as a string of up to 10 characters: '.' followed by 9 character
  754. # 0-padded string representing nanoseconds or empty.
  755. literals.format.boolean=TRUE:FALSE:UNKNOWN
  756. literals.format.char=cast('%1$s' as varchar)
  757. literals.format.clob='%1$s'
  758. literals.format.date=DATE '%1$04d-%2$02d-%3$02d'
  759. literals.format.interval_day=
  760. literals.format.interval_day_to_hour=
  761. literals.format.interval_day_to_minute=
  762. # presto only accepts 8 fractional places
  763. literals.format.interval_day_to_second=INTERVAL %8$s'%1$d %2$02d:%3$02d:%4$02d%5$.8s' DAY TO SECOND
  764. literals.format.interval_hour=
  765. literals.format.interval_hour_to_minute=
  766. literals.format.interval_hour_to_second=
  767. literals.format.interval_minute=
  768. literals.format.interval_minute_to_second=
  769. literals.format.interval_month=
  770. literals.format.interval_second=
  771. literals.format.interval_year=
  772. literals.format.interval_year_to_month=INTERVAL %4$s'%1$d-%2$d' YEAR TO MONTH
  773. literals.format.nchar='%1$s'
  774. literals.format.nvarchar='%1$s'
  775. literals.format.time=TIME '%1$02d:%2$02d:%3$02d%4$.3s'
  776. literals.format.time_with_time_zone=TIME '%1$02d:%2$02d:%3$02d%4$.3s%7$c%5$02d:%6$02d'
  777. literals.format.timestamp=TIMESTAMP '%1$04d-%2$02d-%3$02d %4$02d:%5$02d:%6$02d%7$.3s'
  778. literals.format.timestamp_with_time_zone=TIMESTAMP '%1$04d-%2$02d-%3$02d %4$02d:%5$02d:%6$02d%7$.3s%10$c%8$02d:%9$02d'
  779. literals.format.varchar='%s'
  780. # otherwise presto treat x.y as double type
  781. literals.format.decimal=decimal '%s'
  782. #
  783. # DataTypes
  784. #
  785. dataType.smallint=true
  786. dataType.integer=true
  787. dataType.long=true
  788. dataType.decimal=true
  789. dataType.float=true
  790. dataType.double=true
  791. dataType.char=false
  792. dataType.nchar=false
  793. dataType.varchar=true
  794. dataType.nvarchar=false
  795. dataType.clob=false
  796. dataType.blob=false
  797. dataType.date=true
  798. dataType.time=true
  799. dataType.time_with_time_zone=false
  800. dataType.timestamp=true
  801. dataType.timestamp_with_time_zone=true
  802. dataType.interval_year=false
  803. dataType.interval_month=false
  804. dataType.interval_year_to_month=true
  805. dataType.interval_day=false
  806. dataType.interval_hour=false
  807. dataType.interval_minute=false
  808. dataType.interval_second=false
  809. dataType.interval_day_to_hour=false
  810. dataType.interval_day_to_minute=false
  811. dataType.interval_day_to_second=true
  812. dataType.interval_hour_to_minute=false
  813. dataType.interval_hour_to_second=false
  814. dataType.interval_minute_to_second=false
  815. dataType.boolean=true
  816. dataType.binary=false
  817. dataType.xml=false
  818. dataType.perioddate=false
  819. dataType.array=false
  820. dataType.struct=false
  821. dataType.map=false
  822. dataType.json=false
  823. #
  824. # Collation
  825. #
  826. # Collation Sequence SQL (SQL statement for retrieving the collation sequence)
  827. # This statement returns a single row and single column containing the collation sequence
  828. collation.sequence.sql=
  829. # Datbase Encoding SQL. This statement retrieves the charset name for the non-unicode character data.
  830. # This statement returns a single row and single column with the charset name for use in a java.nio.CharsetEncoder.
  831. database.charset.sql=
  832. #
  833. # dataType.comparable
  834. #
  835. # Used to indicate that some data types that are comparable locally may not by the database
  836. # e.g. dataType.comparable[varchar,nvarchar]=false
  837. #
  838. # dataType.promotion
  839. #
  840. # Used to indicate what direction the promotion needs to occur
  841. # <lhs> -> <rhs> these properties are not symetrical
  842. # e.g. dataType.promotion[char,nvarchar]=true