Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33803

Sort table properties by key in DESCRIBE TABLE command

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • SQL
    • None

    Description

      Currently:

      -- !query
      DESC FORMATTED v
      -- !query schema
      struct<col_name:string,data_type:string,comment:string>
      -- !query output
      a                   	string              	                    
      b                   	int                 	                    
      c                   	string              	                    
      d                   	string              	                    
                          	                    	                    
      # Detailed Table Information	                    	                    
      Database            	default             	                    
      Table               	v                   	                    
      Created Time [not included in comparison]
      Last Access [not included in comparison]
      Created By [not included in comparison]
      Type                	VIEW                	                    
      View Text           	SELECT * FROM t     	                    
      View Original Text  	SELECT * FROM t     	                    
      View Catalog and Namespace	spark_catalog.default	                    
      View Query Output Columns	[a, b, c, d]        	                    
      Table Properties    	[view.catalogAndNamespace.numParts=2, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=default, view.query.out.col.0=a, view.query.out.col.1=b, view.query.out.col.2=c, view.query.out.col.3=d, view.query.out.numCols=4, view.referredTempFunctionsNames=[], view.referredTempViewNames=[]]
      

      The order of "Table Properties" is indeterministic which makes the test above fails in other environments. It should be best to sort it by key. This is consistent with DSv2 command as well.

      Attachments

        Activity

          People

            gurwls223 Hyukjin Kwon
            gurwls223 Hyukjin Kwon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: