mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 10:39:30 +00:00 
			
		
		
		
	add cast to text before length() (#4926)
Co-authored-by: Filip Rembiałkowski <filip.rembialkowski@gmail.com>
This commit is contained in:
		
							parent
							
								
									cfab77c854
								
							
						
					
					
						commit
						d194a40445
					
				| @ -34,7 +34,6 @@ def _(element, compiler, **kw): | |||||||
| @compiles(LenFn, Dialects.SQLite) | @compiles(LenFn, Dialects.SQLite) | ||||||
| @compiles(LenFn, Dialects.Vertica) | @compiles(LenFn, Dialects.Vertica) | ||||||
| @compiles(LenFn, Dialects.Hive) | @compiles(LenFn, Dialects.Hive) | ||||||
| @compiles(LenFn, Dialects.Postgres) |  | ||||||
| @compiles(LenFn, Dialects.Databricks) | @compiles(LenFn, Dialects.Databricks) | ||||||
| @compiles(LenFn, Dialects.MySQL) | @compiles(LenFn, Dialects.MySQL) | ||||||
| @compiles(LenFn, Dialects.MariaDB) | @compiles(LenFn, Dialects.MariaDB) | ||||||
| @ -43,3 +42,8 @@ def _(element, compiler, **kw): | |||||||
| @compiles(LenFn, Dialects.Presto) | @compiles(LenFn, Dialects.Presto) | ||||||
| def _(element, compiler, **kw): | def _(element, compiler, **kw): | ||||||
|     return "LENGTH(%s)" % compiler.process(element.clauses, **kw) |     return "LENGTH(%s)" % compiler.process(element.clauses, **kw) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | @compiles(LenFn, Dialects.Postgres) | ||||||
|  | def _(element, compiler, **kw): | ||||||
|  |     return "LENGTH(CAST(%s AS text))" % compiler.process(element.clauses, **kw) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Filip Rembiałkowski
						Filip Rembiałkowski