@@ -744,6 +744,86 @@ fn test_format_with_subcommand_conflict() {
744744 ) ) ;
745745}
746746
747+ /// Test that using --parquet-compression together with a subcommand errors
748+ #[ test]
749+ fn test_parquet_compression_with_subcommand_conflict ( ) {
750+ let temp_dir = tempdir ( ) . expect ( "Failed to create temporary directory" ) ;
751+
752+ // With parquet subcommand
753+ cargo_bin_cmd ! ( "tpchgen-cli" )
754+ . arg ( "--parquet-compression" )
755+ . arg ( "SNAPPY" )
756+ . arg ( "parquet" )
757+ . arg ( "--scale-factor" )
758+ . arg ( "0.001" )
759+ . arg ( "--tables" )
760+ . arg ( "part" )
761+ . arg ( "--output-dir" )
762+ . arg ( temp_dir. path ( ) )
763+ . assert ( )
764+ . failure ( )
765+ . stderr ( predicates:: str:: contains (
766+ "Cannot use --parquet-compression with a subcommand" ,
767+ ) ) ;
768+
769+ // With tbl subcommand
770+ cargo_bin_cmd ! ( "tpchgen-cli" )
771+ . arg ( "--parquet-compression" )
772+ . arg ( "SNAPPY" )
773+ . arg ( "tbl" )
774+ . arg ( "--scale-factor" )
775+ . arg ( "0.001" )
776+ . arg ( "--tables" )
777+ . arg ( "part" )
778+ . arg ( "--output-dir" )
779+ . arg ( temp_dir. path ( ) )
780+ . assert ( )
781+ . failure ( )
782+ . stderr ( predicates:: str:: contains (
783+ "Cannot use --parquet-compression with a subcommand" ,
784+ ) ) ;
785+ }
786+
787+ /// Test that using --parquet-row-group-bytes together with a subcommand errors
788+ #[ test]
789+ fn test_parquet_row_group_bytes_with_subcommand_conflict ( ) {
790+ let temp_dir = tempdir ( ) . expect ( "Failed to create temporary directory" ) ;
791+
792+ // With parquet subcommand
793+ cargo_bin_cmd ! ( "tpchgen-cli" )
794+ . arg ( "--parquet-row-group-bytes" )
795+ . arg ( "1000000" )
796+ . arg ( "parquet" )
797+ . arg ( "--scale-factor" )
798+ . arg ( "0.001" )
799+ . arg ( "--tables" )
800+ . arg ( "part" )
801+ . arg ( "--output-dir" )
802+ . arg ( temp_dir. path ( ) )
803+ . assert ( )
804+ . failure ( )
805+ . stderr ( predicates:: str:: contains (
806+ "Cannot use --parquet-row-group-bytes with a subcommand" ,
807+ ) ) ;
808+
809+ // With csv subcommand
810+ cargo_bin_cmd ! ( "tpchgen-cli" )
811+ . arg ( "--parquet-row-group-bytes" )
812+ . arg ( "1000000" )
813+ . arg ( "csv" )
814+ . arg ( "--scale-factor" )
815+ . arg ( "0.001" )
816+ . arg ( "--tables" )
817+ . arg ( "part" )
818+ . arg ( "--output-dir" )
819+ . arg ( temp_dir. path ( ) )
820+ . assert ( )
821+ . failure ( )
822+ . stderr ( predicates:: str:: contains (
823+ "Cannot use --parquet-row-group-bytes with a subcommand" ,
824+ ) ) ;
825+ }
826+
747827/// Test that running with no --format and no subcommand defaults to TBL
748828#[ test]
749829fn test_default_format_is_tbl ( ) {
0 commit comments