Skip to content

Commit

Permalink
[CALCITE-6388] PsTableFunction throws NumberFormatException when the …
Browse files Browse the repository at this point in the history
…'user' column has spaces
  • Loading branch information
asolimando committed Apr 27, 2024
1 parent aa8d81b commit a844cde
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ public static ScannableTable eval(boolean b) {
case "Mac OS X": // tested on version 10.12.5
args = new String[] {
"ps", "ax", "-o", "ppid=,pid=,pgid=,tpgid=,stat=,"
+ "user=,pcpu=,pmem=,vsz=,rss=,tty=,start=,time=,uid=,ruid=,"
+ "sess=,comm="};
+ "pcpu=,pmem=,vsz=,rss=,tty=,start=,time=,uid=,ruid=,"
+ "sess=,comm=,user="};
break;
default:
args = new String[] {
"ps", "--no-headers", "axo", "ppid,pid,pgrp,"
+ "tpgid,stat,user,pcpu,pmem,vsz,rss,tty,start_time,time,euid,"
+ "ruid,sess,comm"};
+ "tpgid,stat,pcpu,pmem,vsz,rss,tty,start_time,time,euid,"
+ "ruid,sess,comm,user"};
}
return Processes.processLines(args)
.select(
new Function1<String, Object[]>() {
@Override public Object[] apply(String line) {
final String[] fields = line.trim().split(" +");
final String[] fields = line.trim().split(" +", fieldNames.size());
final Object[] values = new Object[fieldNames.size()];
for (int i = 0; i < values.length; i++) {
try {
Expand Down

0 comments on commit a844cde

Please sign in to comment.