kafka-source-errors.td 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. $ set-arg-default single-replica-cluster=quickstart
  10. $ set-sql-timeout duration=60s
  11. # Test that Kafka sources with no format are disallowed.
  12. $ kafka-create-topic topic=thetopic partitions=1
  13. > CREATE CONNECTION kafka_conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  14. ! CREATE CONNECTION no_broker TO KAFKA (BROKER '');
  15. contains:Meta data fetch error: BrokerTransportFailure (Local: Broker transport failure)
  16. # Verify that incorrect/unreachable brokers throw up an error on source creation.
  17. ! CREATE CONNECTION fawlty_kafka_conn
  18. TO KAFKA (BROKER 'non-existent-broker:9092');
  19. regex:Failed to resolve hostname|Broker transport failure
  20. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  21. URL '${testdrive.schema-registry-url}'
  22. );
  23. ! CREATE CONNECTION IF NOT EXISTS fawlty_csr_conn TO CONFLUENT SCHEMA REGISTRY (
  24. URL 'http://non-existent-csr:8081'
  25. );
  26. contains:failed to lookup address information
  27. # Check that for all tables clause is rejected
  28. ! CREATE SOURCE bad_definition1
  29. IN CLUSTER ${arg.single-replica-cluster}
  30. FROM KAFKA CONNECTION kafka_conn (TOPIC 'any_topic')
  31. FORMAT BYTES FOR ALL TABLES;
  32. contains: FOR ALL TABLES is only valid for multi-output sources
  33. # Check that for tables() clause is rejected
  34. ! CREATE SOURCE bad_definition2
  35. IN CLUSTER ${arg.single-replica-cluster}
  36. FROM KAFKA CONNECTION kafka_conn (TOPIC 'any_topic')
  37. FORMAT BYTES FOR TABLES (t1);
  38. contains: FOR TABLES (t1) is only valid for multi-output sources
  39. # Ensure the `TOPIC METADATA REFRESH INTERVAL` rejects too large and too
  40. # small values.
  41. ! CREATE SOURCE bad_topic_metadata_refresh_interval
  42. IN CLUSTER ${arg.single-replica-cluster}
  43. FROM KAFKA CONNECTION kafka_conn (
  44. TOPIC 'testdrive-thetopic-${testdrive.seed}',
  45. TOPIC METADATA REFRESH INTERVAL '-30s'
  46. )
  47. FORMAT TEXT
  48. ENVELOPE NONE
  49. contains:cannot convert negative interval to duration
  50. ! CREATE SOURCE bad_topic_metadata_refresh_interval
  51. IN CLUSTER ${arg.single-replica-cluster}
  52. FROM KAFKA CONNECTION kafka_conn (
  53. TOPIC 'testdrive-thetopic-${testdrive.seed}',
  54. TOPIC METADATA REFRESH INTERVAL '1hr 1ms'
  55. )
  56. FORMAT TEXT
  57. ENVELOPE NONE
  58. contains:TOPIC METADATA REFRESH INTERVAL cannot be greater than 1 hour
  59. ! CREATE SOURCE bad_topic
  60. IN CLUSTER ${arg.single-replica-cluster}
  61. FROM KAFKA CONNECTION kafka_conn (TOPIC 'whatever')
  62. FORMAT TEXT
  63. ENVELOPE NONE
  64. contains:Topic does not exist