Write a Python function to parse a complex JSON file and flatten it into a table.
Implement flatten_json(json_text). The input is a JSON string containing an array of objects. Flatten nested object keys using dot notation, such as customer.address.city. Arrays of objects must expand into multiple rows, while arrays of scalar values remain unchanged in their flattened field. Return a list of dictionaries. Missing fields may be absent from individual output rows. Arrays are either arrays of objects or arrays of scalar values.
def flatten_json(json_text):