kafka-source-errors.td 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. ! CREATE SOURCE bad_definition1
  28. IN CLUSTER ${arg.single-replica-cluster}
  29. FROM KAFKA CONNECTION kafka_conn (TOPIC 'any_topic');
  30. contains:Topic does not exist
  31. # Check that for all tables clause is rejected (old syntax on purpose)
  32. ! CREATE SOURCE bad_definition1_src
  33. IN CLUSTER ${arg.single-replica-cluster}
  34. FROM KAFKA CONNECTION kafka_conn (
  35. TOPIC 'testdrive-thetopic-${testdrive.seed}'
  36. )
  37. FORMAT BYTES
  38. FOR ALL TABLES;
  39. contains: FOR ALL TABLES is only valid for multi-output sources
  40. # Ensure the `TOPIC METADATA REFRESH INTERVAL` rejects too large and too
  41. # small values.
  42. ! CREATE SOURCE bad_topic_metadata_refresh_interval
  43. IN CLUSTER ${arg.single-replica-cluster}
  44. FROM KAFKA CONNECTION kafka_conn (
  45. TOPIC 'testdrive-thetopic-${testdrive.seed}',
  46. TOPIC METADATA REFRESH INTERVAL '-30s'
  47. )
  48. contains:cannot convert negative interval to duration
  49. ! CREATE SOURCE bad_topic_metadata_refresh_interval
  50. IN CLUSTER ${arg.single-replica-cluster}
  51. FROM KAFKA CONNECTION kafka_conn (
  52. TOPIC 'testdrive-thetopic-${testdrive.seed}',
  53. TOPIC METADATA REFRESH INTERVAL '1hr 1ms'
  54. )
  55. contains:TOPIC METADATA REFRESH INTERVAL cannot be greater than 1 hour