6_bytea_dataflow.slt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 TABLE t_using_dataflow_rendering (f1 TEXT);
  13. statement ok
  14. INSERT INTO t_using_dataflow_rendering VALUES ('ABCDef');
  15. query TT
  16. SELECT
  17. CAST(f1 AS BYTEA),
  18. SHA512(CAST(f1 AS BYTEA))
  19. FROM t_using_dataflow_rendering;
  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 t_using_dataflow_rendering;
  29. ----
  30. Explained Query:
  31. Project (#1, #2)
  32. Map (text_to_bytea(#0{f1}), digest(#1{"?column?"}, "sha512"))
  33. ReadStorage materialize.public.t_using_dataflow_rendering
  34. Source materialize.public.t_using_dataflow_rendering
  35. Target cluster: quickstart
  36. EOF