Skip to content

Commit

Permalink
removed query string display in command ouput
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrivedi12 committed Jul 9, 2024
1 parent 8ade068 commit fc5472e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hive.ql.processors;

import com.google.common.base.Joiner;
Expand Down Expand Up @@ -42,7 +59,6 @@ private Schema getSchema(){
sch.addToFieldSchemas(new FieldSchema("Opened Timestamp", "string", ""));
sch.addToFieldSchemas(new FieldSchema("Elapsed Time (s)", "string", ""));
sch.addToFieldSchemas(new FieldSchema("Runtime (s)", "string", ""));
sch.addToFieldSchemas(new FieldSchema("Query", "string", ""));
sch.putToProperties(SERIALIZATION_NULL_FORMAT, defaultNullString);
return sch;
}
Expand Down Expand Up @@ -74,8 +90,7 @@ public CommandProcessorResponse run(String command) throws CommandProcessorExcep
query.getState(),
query.getBeginTime(),
query.getElapsedTime(),
query.getRuntime(),
query.getQueryDisplay()
query.getRuntime()
));
}
);
Expand Down
38 changes: 19 additions & 19 deletions ql/src/java/org/apache/hadoop/hive/ql/session/ProcessListInfo.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hive.ql.session;

/**
Expand All @@ -15,11 +32,10 @@ public class ProcessListInfo {
private final String runtime; // tracks only running portion of the query.
private final long elapsedTime;
private final String state;
private final String queryDisplay;

private ProcessListInfo( String userName, String ipAddr, String sessionId, long sessionActiveTime,
long sessionIdleTime,String queryId, String executionEngine, long beginTime,
String runtime, long elapsedTime, String state, String queryDisplay) {
String runtime, long elapsedTime, String state ) {
this.userName = userName;
this.ipAddr = ipAddr;
this.sessionId = sessionId;
Expand All @@ -31,11 +47,9 @@ private ProcessListInfo( String userName, String ipAddr, String sessionId, long
this.runtime= runtime;
this.elapsedTime = elapsedTime;
this.state = state;
this.queryDisplay = queryDisplay;
}

public String getSessionId() { return sessionId; }

public String getUserName() {
return userName;
}
Expand All @@ -45,19 +59,11 @@ public String getIpAddr() {
public long getSessionActiveTime() { return sessionActiveTime; }
public long getSessionIdleTime() { return sessionIdleTime; }
public String getExecutionEngine() { return executionEngine; }

public long getBeginTime() { return beginTime; }

public String getQueryId() { return queryId; }

public String getRuntime() { return runtime; }

public long getElapsedTime() { return elapsedTime; }

public String getState() { return state; }

public String getQueryDisplay() { return queryDisplay; }

public static class Builder {
private String userName ;
private String ipAddr;
Expand All @@ -70,7 +76,6 @@ public static class Builder {
private String runtime;
private long elapsedTime;
private String state;
private String queryDisplay;

public Builder setSessionId(String sessionId){
this.sessionId = sessionId;
Expand Down Expand Up @@ -127,15 +132,10 @@ public Builder setState(String state) {
return this;
}

public Builder setQueryDisplay(String queryDisplay) {
this.queryDisplay = queryDisplay;
return this;
}

public ProcessListInfo build() {
ProcessListInfo processListInfo = new ProcessListInfo(userName, ipAddr, sessionId, sessionActiveTime,
sessionIdleTime, queryId, executionEngine, beginTime, runtime,
elapsedTime, state, queryDisplay);
elapsedTime, state);
return processListInfo;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ private List<ProcessListInfo> getLiveQueryInfos(HiveSession parentSession) {
.setRuntime(query.getRuntime() == null ? "Not finished" : String.valueOf(query.getRuntime() / 1000))
.setElapsedTime(query.getElapsedTime() / 1000)
.setState(query.getState())
.setQueryDisplay(query.getQueryDisplay() == null ? "Unknown" : query.getQueryDisplay().getQueryString())
.build();
})
.collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hive.service.cli.operation;

import com.google.common.collect.ImmutableMap;
Expand Down

0 comments on commit fc5472e

Please sign in to comment.