6_bytea_folding.slt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # use mode standard to avoid formatting issues
  10. mode standard
  11. statement ok
  12. CREATE VIEW v_using_constant_folding (f1) AS
  13. SELECT
  14. 'ABCDef';
  15. query TT
  16. SELECT
  17. CAST(f1 AS BYTEA),
  18. SHA512(CAST(f1 AS BYTEA))
  19. FROM v_using_constant_folding;
  20. ----
  21. ABCDef
  22. [238, 226, 119, 230, 210, 45, 158, 105, 232, 127, 11, 125, 76, 10, 244, 149, 96, 158, 231, 207, 230, 136, 216, 56, 30, 157, 228, 74, 89, 49, 203, 21, 238, 196, 151, 235, 205, 247, 59, 41, 81, 87, 67, 152, 170, 149, 41, 38, 39, 103, 214, 97, 156, 131, 169, 93, 142, 69, 43, 29, 72, 113, 255, 236]
  23. query T multiline
  24. EXPLAIN OPTIMIZED PLAN WITH (humanized expressions) AS VERBOSE TEXT FOR
  25. SELECT
  26. CAST(f1 AS BYTEA),
  27. SHA512(CAST(f1 AS BYTEA))
  28. FROM v_using_constant_folding;
  29. ----
  30. Explained Query (fast path):
  31. Constant
  32. - (0x414243446566, 0xeee277e6d22d9e69e87f0b7d4c0af495609ee7cfe688d8381e9de44a5931cb15eec497ebcdf73b2951574398aa9529262767d6619c83a95d8e452b1d4871ffec)
  33. Target cluster: quickstart
  34. EOF