Skip to content

utf8_encode difference between result in SQL and PHP

I’m using utf8_encode to make sure that the input from my users is transforming the special characters to a character where my MYSQL can do a search on. (My database is set in latin1_swedish.ci). When …

Change null to empty array in databricks SQL?

I have a value in a JSON column that is sometimes all null in an Azure Databricks table. The full process to get to JSON_TABLE is: read parquet, infer schema of JSON column, convert the column from JSON string to deeply nested structure, explode any arrays within. I am working in SQL with python-defined UDFs …

Fill in Missing Values in Query

Say we have this dataset: Two students are enrolled in two different courses and attendance is taken for each student. I am interested in finding the attendance_dates for the students for which either one of them or both of them missed the respective subject. For the subject and the attendance_dates the stude…