You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ast_rewrite.go
    path of file: ./repos/rill/runtime/pkg/duckdbsql
    
    the code of the file until where you have to start completion: package duckdbsql

import (
	"encoding/json"
	"fmt"
	"math"
)

func (fn *fromNode) rewriteToBaseTable(name string) error {
	baseTable, err := createBaseTable(name, fn.ast)
	if err != nil {
		return err
	}
	fn.parent[fn.childKey] = baseTable
	return nil
}

func (fn *fromNode) rewriteToReadTableFunction(name string, paths []string, props map[string]any) error {
	baseTable, err := createTableFunction(name, paths, props, fn.ast)
	if err != nil {
		return err
	}
	fn.parent[fn.childKey] = baseTable
	return n
    
func createTableFunction(name string, paths []string, props map[string]any, ast astNode) (astNode, error) {
	var n astNode
	err := json.Unmarshal([]byte(fmt.Sprintf(`{
  "type": "TABLE_FUNCTION",
  "alias": "%s",
  "sample": null,
  "function": {},
  "column_name_alias": []
}`, toString(ast, astKeyAlias))), &n)
	if err != nil {
		return nil, err
	}

	fn, err := createFunctionCall("", name, "")
	if err != nil {
		return nil, err
	}
	n[astKeyFunction] = fn

	pa, err := createListValue[string]("", paths)
	if err != nil {
		return nil, err
	}
	// create the list of args with the 1st arg being the list of path
	args := []astNode{pa}

	for k, v := range props {
		vn, err := createKeyedFunctionArg(k, v)
		if err != nil {
			return nil, err
		}
		if vn == nil {
			continue
		}
		args = append(args, vn)
	}

	fn[astKeyChildren] = args

	return n, nil
}