xinyiZzz commented on code in PR #31763:
URL: https://github.com/apache/doris/pull/31763#discussion_r1513940706


##########
fe/fe-core/src/main/java/org/apache/doris/plsql/functions/DorisFunctionRegistry.java:
##########
@@ -85,6 +89,37 @@ private String qualified(String name) {
         return (ConnectContext.get().getDatabase() + "." + name).toUpperCase();
     }
 
+    @Override
+    public void showProcedure(List<List<String>> columns) {
+        Map<PlsqlProcedureKey, PlsqlStoredProcedure> allProc = 
client.getAllPlsqlStoredProcedures();
+        for (Map.Entry<PlsqlProcedureKey, PlsqlStoredProcedure> entry : 
allProc.entrySet()) {
+            List<String> row = new ArrayList<>();
+            PlsqlStoredProcedure proc = entry.getValue();
+            row.add(proc.getName());
+            row.add(Long.toString(proc.getCatalogId()));
+            row.add(Long.toString(proc.getDbId()));
+            row.add(proc.getPackageName());
+            row.add(proc.getOwnerName());
+            row.add(proc.getCreateTime());
+            row.add(proc.getModifyTime());
+            row.add(proc.getSource());
+            columns.add(row);
+        }
+    }
+
+    @Override
+    public void showCreateProcedure(FuncNameInfo procedureName, 
List<List<String>> columns) {
+        Map<PlsqlProcedureKey, PlsqlStoredProcedure> allProc = 
client.getAllPlsqlStoredProcedures();

Review Comment:
   use `client.getPlsqlStoredProcedure(procedureName.getName(), 
procedureName.getCtlId(), procedureName.getDbId())` instead of 
`getAllPlsqlStoredProcedures`
   do not get all then check procedureName



##########
fe/fe-core/src/main/java/org/apache/doris/plsql/functions/DorisFunctionRegistry.java:
##########
@@ -196,10 +231,19 @@ public void addUserProcedure(Create_procedure_stmtContext 
ctx) {
     @Override
     public void save(FuncNameInfo procedureName, String source, boolean 
isForce) {
         try {
+            SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String createTime = f.format(Calendar.getInstance().getTime());
+            String modifyTime = f.format(Calendar.getInstance().getTime());

Review Comment:
   createTime and modifyTime may not be equal because get the current time 
separately
   
   `String modifyTime=createTime` seems better



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to