plusplusjiajia commented on code in PR #7377:
URL: https://github.com/apache/paimon/pull/7377#discussion_r2904515807


##########
paimon-python/pypaimon/tests/cli_table_test.py:
##########
@@ -128,6 +128,27 @@ def test_cli_table_read_with_limit(self):
                 # Should have header + 2 data rows
                 self.assertLessEqual(len(lines), 4)  # header + 2 data rows + 
possible empty lines
 
+    def test_cli_table_read_with_select(self):
+        """Test table read with column selection via CLI."""
+        # Simulate CLI command: paimon table read test_db.users --select 
id,name
+        with patch('sys.argv',
+                   ['paimon', '-c', self.config_file,
+                    'table', 'read', 'test_db.users', '--select', 'id,name']):
+            with patch('sys.stdout', new_callable=StringIO) as mock_stdout:
+                try:
+                    main()
+                except SystemExit:
+                    pass
+                
+                output = mock_stdout.getvalue()
+                
+                # Verify output contains selected columns
+                self.assertIn('id', output.lower())
+                self.assertIn('name', output.lower())
+                # Verify selected data is present
+                self.assertIn('Alice', output)
+                self.assertIn('Bob', output)

Review Comment:
   better to add some bad cases, such as  the invalid column names are passed 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to