hidden-hosts.td 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Test creating a source that uses Kafka/CSR via an SSH tunnel where the Kafka
  10. # broker and CSR server have hostnames that can only be resolved from the
  11. # SSH bastion host.
  12. #
  13. # The `openssh` crate previously had a bug where it would attempt to resolve
  14. # the target host on the client.
  15. # See: https://github.com/openssh-rust/openssh/pull/120
  16. $ kafka-create-topic topic=thetopic
  17. $ kafka-ingest topic=thetopic format=bytes
  18. one
  19. > CREATE CONNECTION kafka_conn
  20. TO KAFKA (BROKER 'hidden-kafka:9092' USING SSH TUNNEL thancred, SECURITY PROTOCOL PLAINTEXT);
  21. > CREATE CONNECTION csr_conn TO CONFLUENT SCHEMA REGISTRY (
  22. URL 'http://hidden-schema-registry:8081',
  23. SSH TUNNEL thancred
  24. );
  25. $ set schema={
  26. "type" : "record",
  27. "name" : "test",
  28. "fields" : [
  29. {"name":"f1", "type":"string"},
  30. {"name":"f2", "type":"long"}
  31. ]
  32. }
  33. $ kafka-create-topic topic=avroavro
  34. $ kafka-ingest format=avro topic=avroavro schema=${schema}
  35. {"f1": "fish", "f2": 1000}
  36. > CREATE SOURCE csr_source
  37. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-avroavro-${testdrive.seed}')
  38. > CREATE TABLE csr_source_tbl FROM SOURCE csr_source (REFERENCE "testdrive-avroavro-${testdrive.seed}")
  39. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  40. ENVELOPE NONE
  41. > SELECT * FROM csr_source_tbl
  42. f1 f2
  43. ----------
  44. fish 1000